diff options
| author | sostler <sbostler@gmail.com> | 2010-01-24 19:06:49 -0500 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-01-24 19:06:49 -0500 |
| commit | e5b95a258abf453b52061fb3f0df0b8ae5625782 (patch) | |
| tree | 968a24d6489d206041db53dac8ba5a4d7dbdef60 | |
| parent | f693b194db825faee8cd8d9fe9d767fcd1de7f5e (diff) | |
zero-length avatars aren't included in chat userlist
| -rwxr-xr-x | src/site.clj | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/site.clj b/src/site.clj index b5c7ade..972da44 100755 --- a/src/site.clj +++ b/src/site.clj @@ -74,6 +74,9 @@ (defn resp-success [message] {:status 200 :headers {} :body (json-str message)}) +(defn non-empty-string? [s] + (and s (> (count s) 0))) + ;; Database (defn do-select [query] @@ -132,8 +135,7 @@ @(room :messages))))) (defn process-user [u] - (prn u) - (if (u :avatar) + (if (non-empty-string? (u :avatar)) {"nick" (u :nick) "avatar" (encode-html-entities (u :avatar))} {"nick" (u :nick)})) @@ -247,9 +249,6 @@ ;; Profile -(defn non-empty-string? [s] - (and s (> (count s) 0))) - (defn profile [session profile-nick offset] (let [user-info (fetch-nick profile-nick)] (if user-info |
