From d1c51370a79867089f002a0b61cc3c6eb0680d08 Mon Sep 17 00:00:00 2001
From: Matthias Andreas Benkard <code@mail.matthias.benkard.de>
Date: Sat, 18 Aug 2012 16:10:52 +0200
Subject: Fix view user_visible_lazychat_messages; adapt Lafargue
 implementation.

---
 schema.sql | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 8934883..984fdea 100644
--- a/schema.sql
+++ b/schema.sql
@@ -231,9 +231,12 @@ CREATE TRIGGER new_user_create_user_role
   EXECUTE PROCEDURE new_user_create_user_role();
 
 CREATE VIEW user_visible_lazychat_messages AS
-  SELECT eur.user, t.message
-    FROM effective_user_roles eur, lazychat_targets t
-   WHERE t.target = eur.role;
+   SELECT eur.user, t.message
+     FROM effective_user_roles eur, lazychat_targets t
+    WHERE t.target = eur.role
+  UNION
+    SELECT m.author, m.message
+    FROM lazychat_messages m;
 
 ROLLBACK;
 --COMMIT;
-- 
cgit v1.2.3

