summary refs log tree commit diff
path: root/synapse/push/action_generator.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-12-10 18:40:28 +0000
committerDavid Baker <dave@matrix.org>2015-12-10 18:40:28 +0000
commit5e909c73d76cd56e3eac91635a99405182dcac3c (patch)
tree08b13f84598df490b1f92181a446ffad7cddb876 /synapse/push/action_generator.py
parentSave event actions to the db (diff)
downloadsynapse-5e909c73d76cd56e3eac91635a99405182dcac3c.tar.xz
Store nothing instead of ['dont_notify'] for events with no notification required: much as it would be nice to be able to tell between the event not having been processed and there being no notification for it, this isn't worth filling up the table with ['dont_notify'] I think. Consequently treat the empty actions array as dont_notify and filter dont_notify out of the result.
Diffstat (limited to 'synapse/push/action_generator.py')
-rw-r--r--synapse/push/action_generator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/push/action_generator.py b/synapse/push/action_generator.py
index 870c68a0ca..a72a7d703c 100644
--- a/synapse/push/action_generator.py
+++ b/synapse/push/action_generator.py
@@ -35,7 +35,6 @@ class ActionGenerator:
     @defer.inlineCallbacks
     def handle_event(self, event):
         users = yield self.store.get_users_in_room(event['room_id'])
-        logger.error("users in room: %r", users)
 
         for uid in users:
             evaluator = yield push_rule_evaluator.\
@@ -44,6 +43,7 @@ class ActionGenerator:
                 )
             actions = yield evaluator.actions_for_event(event)
             logger.info("actions for user %s: %s", uid, actions)
-            self.store.set_actions_for_event(
-                event['event_id'], uid, None, actions
-            )
+            if len(actions):
+                self.store.set_actions_for_event(
+                    event['event_id'], uid, None, actions
+                )