summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-11-17 01:10:53 -0500
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-11-17 01:10:53 -0500
commit4fc9adaa91c8e09e2f34d9d54de50ca70626ceba (patch)
treed3e2eea9760a00aeca0eebec362246af63c9495f /src
parent2e1afb150bb28c26f63392ea7dc37567c1950528 (diff)
parente9e057b6231a7544e3f7fb2007abe23c7aab224a (diff)
Merge branch 'master' of /pichat/repo
Diffstat (limited to 'src')
-rw-r--r--src/config.clj3
-rw-r--r--src/datalayer.clj3
-rw-r--r--src/rooms.clj2
-rw-r--r--src/site.clj2
-rwxr-xr-xsrc/utils.clj3
5 files changed, 6 insertions, 7 deletions
diff --git a/src/config.clj b/src/config.clj
index fdb33ed..7a4a6a2 100644
--- a/src/config.clj
+++ b/src/config.clj
@@ -28,3 +28,6 @@
;; Numerical constants
(def num-popular-dumps 40)
+(def *dumps-per-page* 20)
+(def *vip-dumps-per-page* 200)
+(def message-count-limit 200)
diff --git a/src/datalayer.clj b/src/datalayer.clj
index 7086b12..38a597e 100644
--- a/src/datalayer.clj
+++ b/src/datalayer.clj
@@ -73,4 +73,5 @@ order by count desc limit ? offset ?")
msg-ids (redis/with-server redis-server
(redis/zrevrange rkey 0 (dec num-popular-dumps)))
msg-ids (map maybe-parse-int msg-ids)]
- (tags/fetch-dumps-by-ids msg-ids viewer-nick))) \ No newline at end of file
+ (if-not (empty? msg-ids)
+ (tags/fetch-dumps-by-ids msg-ids viewer-nick))))
diff --git a/src/rooms.clj b/src/rooms.clj
index e919557..7745630 100644
--- a/src/rooms.clj
+++ b/src/rooms.clj
@@ -101,8 +101,6 @@
(defn build-msg [nick content msg-id]
(struct message-struct nick content (new Date) msg-id))
-(def message-count-limit 200)
-
(defn add-message [msg room]
(insert-and-truncate! (room :messages) msg message-count-limit))
diff --git a/src/site.clj b/src/site.clj
index c492336..f6d7076 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -677,7 +677,7 @@ ORDER BY cnt DESC
mute (resp-error (format-mute mute))
:else
(let [content (validated-content content session)
- msg-id (msg-db user-id (room :room_id) content)]
+ msg-id (msg-db user-id (room :room_id) content)]
(dosync
(if (not (contains? (ensure (room :users)) nick))
(login-user (user-struct-from-session session) room))
diff --git a/src/utils.clj b/src/utils.clj
index 9d7fd3a..84454cd 100755
--- a/src/utils.clj
+++ b/src/utils.clj
@@ -35,9 +35,6 @@
(.setPassword db-pass)
(.setMaxConnections 10))}))
-;; moved this to here which doesn't seem right... maybe a 'settings.clj' or something?
-(def *dumps-per-page* 20)
-(def *vip-dumps-per-page* 200)
;; Message parsing