summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-08-18 17:49:46 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-08-18 17:49:46 +0200
commit28c046e169c5874ce066228e7f3658d02317c216 (patch)
treedba7d84bbfbf7173632b70c9e89fc80282ebe3d6 /src
parent573113dfb99e4d6eb6086b53dee1afcb845c18a9 (diff)
Schema: Genericize access control.
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/lazychat.clj8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mulk/benki/lazychat.clj b/src/mulk/benki/lazychat.clj
index 75b0b16..fefb487 100644
--- a/src/mulk/benki/lazychat.clj
+++ b/src/mulk/benki/lazychat.clj
@@ -62,18 +62,18 @@
[:referrer :referee]
[id (int referee)]))
(doseq [target targets]
- (sql/insert-values :lazychat_targets
+ (sql/insert-values :post_targets
[:message :target]
[id (int target)]))
(case visibility
("public")
(sql/do-prepared
- "INSERT INTO lazychat_targets
+ "INSERT INTO post_targets
SELECT ?, role FROM role_tags WHERE tag = 'world'"
[id])
("protected")
(sql/do-prepared
- "INSERT INTO lazychat_targets
+ "INSERT INTO post_targets
SELECT ?, target FROM user_default_target WHERE (\"user\" = ?)"
[id user])
("private")
@@ -113,7 +113,7 @@
WHERE id = ?"
id)
referees (map :referee (query "SELECT referee FROM lazychat_references WHERE referrer = ?" id))
- targets (map :target (query "SELECT target FROM lazychat_targets WHERE message = ?" id))]
+ targets (map :target (query "SELECT target FROM post_targets WHERE message = ?" id))]
(and message
(assoc message
:referees referees