diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-05-14 23:59:00 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-05-14 23:59:00 -0400 |
| commit | bf4f19400e5aae3b27a7853d79d90d3d606315aa (patch) | |
| tree | 3891bc324255c90412b3b0432a081271ca1d20db | |
| parent | 9f16a91226b9b59a51e701c3f8e35b630e9e0d20 (diff) | |
| parent | 43a4c7ce3ea0c4278232a0b93c4876372ca7e037 (diff) | |
Merge branch 'master' of /pichat/repo
| -rw-r--r-- | src/admin.clj | 15 | ||||
| -rw-r--r-- | template/mutes.st | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/admin.clj b/src/admin.clj index 76e690a..e5d3e04 100644 --- a/src/admin.clj +++ b/src/admin.clj @@ -66,10 +66,6 @@ LIMIT 1 *mute-refresh-period-sec* nil)) -(defn mute-status [session] - (if-vip - (println session))) - (defn parse-pos-interval [time unit] (let [t (maybe-parse-int time 0) u (lower-case unit)] @@ -106,25 +102,28 @@ WHERE mute_id = ? AND cancelled = false ") -(defn cancel-mute! [mute-id admin-id] +(defn cancel-mute! [mute-id admin-id reason] (let [mute (fetch-mute mute-id) active (nor (:expired mute) (:cancelled mute)) qry "mute_id = ? AND cancelled = false AND (set_on + duration) > now()"] (cond (not mute) (resp-error "INVALID_MUTE_ID") (not active) (resp-error "EXPIRED_MUTE") + (not reason) (resp-error "NO_REASON") :else (assert-update (do-update :mutes [qry mute-id] - {:cancelled true - :cancel_admin_id admin-id}) + {:cancelled true + :cancel_admin_id admin-id + :cancel_reason reason}) (resp-success "OK") (resp-error "UPDATE_ERROR"))))) (defn handle-cancel-mute! [session params] (if-vip (let [mute-id (maybe-parse-int (params :mute_id) 0) + reason (params :reason) admin-id (session :user_id)] - (cancel-mute! mute-id admin-id)))) + (cancel-mute! mute-id admin-id reason)))) (defn format-mute [mute] (format (str "I'm sorry, you've been muted for %s. " diff --git a/template/mutes.st b/template/mutes.st index c697705..e826e8d 100644 --- a/template/mutes.st +++ b/template/mutes.st @@ -93,7 +93,7 @@ <td class="reason">$m.reason$</td> <td>$m.cancelled$</td> <td>$m.cancel_nick$</td> - <td class="cancel-reason"></td> + <td class="cancel-reason">$m.cancel_reason$</td> </tr> }$ </tbody> |
