diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-26 19:40:29 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-26 19:40:29 +0100 |
commit | 67c5f89244b9ff5f1deca199f35ef7240d0549cc (patch) | |
tree | 04abccb8896322ecf086bdd18d290f3dbfc537a7 /synapse/notifier.py | |
parent | Fix exceptions so that the event stream works. Presence like events are turne... (diff) | |
download | synapse-67c5f89244b9ff5f1deca199f35ef7240d0549cc.tar.xz |
Enable presence again. Fix up api to match old api.
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py index 1911fd20ae..df9be29f3d 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -91,7 +91,25 @@ class Notifier(object): ) def on_new_user_event(self, *args, **kwargs): - pass + source = self.event_sources.sources[1] + + listeners = self.signal_keys_to_users.get( + (source.SIGNAL_NAME, "moose"), + [] + ) + + for listener in listeners: + events, end_token = yield source.get_new_events_for_user( + listener.user, + listener.from_token, + listener.limit, + key="moose", + ) + + if events: + listener.notify( + self, events, listener.from_token, end_token + ) def get_events_for(self, user, pagination_config, timeout): deferred = defer.Deferred() |