summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/0-create.psql3
-rw-r--r--src/rooms.clj4
-rw-r--r--src/site.clj9
3 files changed, 9 insertions, 7 deletions
diff --git a/db/0-create.psql b/db/0-create.psql
index 3cb7236..3a8f1c4 100644
--- a/db/0-create.psql
+++ b/db/0-create.psql
@@ -21,7 +21,8 @@ CREATE TABLE rooms (
name text NOT NULL,
description text NOT NULL,
created_on timestamp NOT NULL DEFAULT now(),
- admin_only bool NOT NULL DEFAULT false
+ admin_only bool NOT NULL DEFAULT false,
+ active bool NOT NULL DEFAULT true
);
CREATE TABLE messages (
diff --git a/src/rooms.clj b/src/rooms.clj
index 5e1feb1..32239d2 100644
--- a/src/rooms.clj
+++ b/src/rooms.clj
@@ -35,10 +35,10 @@
(@rooms (lower-case key)))
(defn fetch-room [key]
- (first (do-select ["SELECT * FROM rooms WHERE key = LOWER(?)" key])))
+ (first (do-select ["SELECT * FROM rooms WHERE key = LOWER(?) AND active" key])))
(defn fetch-rooms []
- (do-select ["SELECT * FROM ROOMS"]))
+ (do-select ["SELECT * FROM ROOMS WHERE active"]))
(defn count-messages-by-room [room-id image-only]
(let [query (str "SELECT COUNT(*)
diff --git a/src/site.clj b/src/site.clj
index a221fb4..a472dfe 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -329,11 +329,12 @@ ORDER BY cnt DESC;
(def *piece-map*
(zipmap
- [:pawn :knight :bishop :rook :queen :king]
- ["♟" "♞" "♝" "♜" "♛" "♚"]))
+ [:pawn :knight :bishop :rook :queen :king :skull]
+ ["♟" "♞" "♝" "♜" "♛" "♚" "☠"]))
(defn score-to-piece [score]
- (cond (= score 0) :pawn
+ (cond (= score -1) :skull
+ (= score 0) :pawn
(< score 50) :knight
(< score 150) :bishop
(< score 300) :rook
@@ -388,7 +389,7 @@ ORDER BY created_on DESC;
has-avatar (non-empty-string? (user-info :avatar))
offset (maybe-parse-int offset 0)
score (if (= (lower-case profile-nick) "scottbot")
- 9999
+ -1
(or ((poll *user-scores*) profile-nick) 0))
dump-offset (* offset *dumps-per-page*)
raw-dumps (logger tags/fetch-dumps-by-nick