diff options
Diffstat (limited to 'src/site.clj')
| -rw-r--r-- | src/site.clj | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/site.clj b/src/site.clj index 90db5dc..43e7f9a 100644 --- a/src/site.clj +++ b/src/site.clj @@ -192,8 +192,18 @@ ;; Landing +(defn front-page [session] + (let [st (fetch-template "frontpage" session) + date-str (format-yyyymmdd (Date.)) + dumps (map process-message-for-output + (fetch-redis-daily-hall date-str 0 100))] + (.setAttribute st "dumps" dumps) + (.toString st))) + (defn landing [session] - (redirect-to "/chat")) + (if (is-vip? session) + (front-page session) + (redirect-to "/chat"))) (defn log-login [user_id ip] ;; i'm using do-cmds here because update-values can't deal with stuff like 'last_login = now()' @@ -763,7 +773,7 @@ WHERE user_id IN (when (and (= tag "favorite") (not (= (msg :nick) (:nick user)))) (if-not (or (:admin_only msg) (= (:user_id user) (:user_id msg))) - (incrby-redis-favscore! (:nick msg) (:message_id msg) 1 (:is_image msg))) + (incrby-redis-favscore! msg 1)) (insert-fav-notification! (msg :nick) (user :nick) (user :avatar) @@ -801,7 +811,7 @@ WHERE user_id IN (if-not (zero? rows-deleted) (do (if-not (or (:admin_only msg) (= user-id (:user_id msg))) - (incrby-redis-favscore! (:nick msg) msg-id -1 (:is_image msg))) + (incrby-redis-favscore! msg -1)) (resp-success "OK")) (resp-error "NO_TAG"))))) @@ -1126,7 +1136,7 @@ WHERE user_id IN (.setAttribute st "dumps" (map process-message-for-output msgs)) (.toString st))) -;; MGMT logic +;; MGMT (def mgmt-pw "idontgetit") |
