diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-24 16:19:43 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-24 16:19:43 +0100 |
commit | f8f3d72e2b6e5b38bb6ab8e057ede454d77d114f (patch) | |
tree | dcc9be8eb8b9fa719843baa844340e629b1b8cb7 /synapse/notifier.py | |
parent | Don't insert events into 'event_*_extremeties' tables if they're outliers (diff) | |
download | synapse-f8f3d72e2b6e5b38bb6ab8e057ede454d77d114f.tar.xz |
Don't make pushers handle presence/typing events
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 7 |
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, ) |