summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Ostler <scottbot9000@gmail.com>2010-06-23 05:13:41 -0400
committerScott Ostler <scottbot9000@gmail.com>2010-06-23 05:13:41 -0400
commite1d45671c8895f3065a166de3ec40c92dd20781f (patch)
tree38c60d90be329ca847784f3b60629f0a21b2b870
parentafdc29ead65a6723a403374e7b90b1cf59d01d8e (diff)
Fix profile bug
-rw-r--r--src/site.clj4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/site.clj b/src/site.clj
index 7577bd2..2777efc 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -401,7 +401,8 @@ FROM users u
;; Profile
(defn take-random-image [content]
- (rand-elt (filter is-image? (.split content " "))))
+ (let [imgs (filter is-image? (.split content " "))]
+ (if (empty? imgs) nil (rand-elt imgs))))
(defn msg-transformer [key f]
(fn [msg] (assoc msg key (f (msg key)))))
@@ -443,6 +444,7 @@ FROM users u
score (lookup-score profile-nick)
raw-dumps (logger tags/fetch-dumps-by-nick
:nick profile-nick
+ :image-only true
:amount 5)
dumps (logger doall
(map (comp process-message-for-output