Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Commit

Permalink
Don't keywordize.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-stuttaford committed Mar 31, 2014
1 parent f1c7138 commit 29fa742
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/clojure/jarvis/command.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@
(:require [jarvis.util :as util]
[clj-flowdock.api.message :as m]
[clojure.string :as s]
[clojure.walk :as walk]
[clojure.tools.logging :as log]))

(declare get-user-id-from-message get-user-ids-from-tags user->id)

(defn tell [message plugin]
(when-let [reply (plugin (walk/keywordize-keys message) (util/message-content->vec message))]
(when-let [reply (plugin message (util/message-content->vec message))]
(let [user-ids (get-user-ids-from-tags message)]
(log/info "Plugin:" (m/content message) "replied:" (str "'" reply "'"))
(m/send-private-messages user-ids reply))))

(defn private-message [message plugin]
(when-let [reply (plugin (walk/keywordize-keys message) (util/message-content->vec message))]
(when-let [reply (plugin message (util/message-content->vec message))]
(let [user-id (get-user-id-from-message message)]
(log/info "Plugin:" (m/content message) "replied to user:" user-id " with content:" (str "'" reply "'"))
(m/send-private-message user-id reply))))

(defn reply [message plugin]
(when-let [reply (plugin (walk/keywordize-keys message) (util/message-content->vec message))]
(log/info "Plugin:" (m/content message) "replied:" (str "'" reply "'"))
(when-let [reply (plugin message (util/message-content->vec message))]
(m/reply message reply)))

(defn tell-command? [message]
Expand Down

0 comments on commit 29fa742

Please sign in to comment.