diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-06-15 13:11:29 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-06-15 13:11:29 -0400 |
| commit | 61c37d913acdea6348adc0386a757f91ddcd15e4 (patch) | |
| tree | da587a4a7dc12b5384c89a051109e5423115fc7c /src/rooms.clj | |
| parent | 91ec3a6721b0b05830a043eb5ee1e47fc53ff001 (diff) | |
Fixed fetch-or-create-bod-id
Diffstat (limited to 'src/rooms.clj')
| -rw-r--r-- | src/rooms.clj | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rooms.clj b/src/rooms.clj index a7fe933..8f54640 100644 --- a/src/rooms.clj +++ b/src/rooms.clj @@ -128,12 +128,12 @@ (throw (Exception. (str "Unable to create room " key)))))) (defn- fetch-or-create-bot-id! [nick] - ((comp :user_id first) - (or [(fetch-nick nick)] - (do - (do-select ["INSERT INTO users (nick, hash, email) - VALUES (?, ?, ?) RETURNING user_id" - nick "GARBAGE" "info@dump.fm"]))))) + (:user_id + (or (fetch-nick nick) + (first + (do-select ["INSERT INTO users (nick, hash, email) + VALUES (?, ?, ?) RETURNING user_id" + nick "GARBAGE" "info@dump.fm"]))))) (def room-bot-id-cache (ref {})) |
