summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-28 11:15:27 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-28 11:15:27 +0100
commita7122692d972ce3ac787d4ecf1449f87f33e83cf (patch)
tree81ece372c764d775d1d10cc581100de006456d67 /synapse/notifier.py
parentMerge pull request #254 from matrix-org/markjh/tox_setuptools (diff)
parentBump version and changelog (diff)
downloadsynapse-a7122692d972ce3ac787d4ecf1449f87f33e83cf.tar.xz
Merge branch 'release-v0.10.0' into develop
Conflicts:
	synapse/handlers/auth.py
	synapse/python_dependencies.py
	synapse/rest/client/v1/login.py
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,
                 )