summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-24 16:23:55 +0100
committerErik Johnston <erik@matrix.org>2015-08-24 16:23:55 +0100
commit61f36d9939e7fb3b7c977d2ce334b3610535d86c (patch)
treedcc9be8eb8b9fa719843baa844340e629b1b8cb7 /synapse/notifier.py
parentDon't insert events into 'event_*_extremeties' tables if they're outliers (diff)
parentDon't make pushers handle presence/typing events (diff)
downloadsynapse-61f36d9939e7fb3b7c977d2ce334b3610535d86c.tar.xz
Merge pull request #242 from matrix-org/erikj/pushers_ephemeral_events
Don't make pushers handle presence/typing events
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index dbd8efe9fb..f998fc83bf 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -328,10 +328,13 @@ class Notifier(object):
         defer.returnValue(result)
 
     @defer.inlineCallbacks
-    def get_events_for(self, user, rooms, pagination_config, timeout):
+    def get_events_for(self, user, rooms, pagination_config, timeout,
+                       only_room_events=False):
         """ For the given user and rooms, return any new events for them. If
         there are no new events wait for up to `timeout` milliseconds for any
         new events to happen before returning.
+
+        If `only_room_events` is `True` only room events will be returned.
         """
         from_token = pagination_config.from_token
         if not from_token:
@@ -352,6 +355,8 @@ class Notifier(object):
                 after_id = getattr(after_token, keyname)
                 if before_id == after_id:
                     continue
+                if only_room_events and name != "room":
+                    continue
                 new_events, new_key = yield source.get_new_events_for_user(
                     user, getattr(from_token, keyname), limit,
                 )