diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-29 19:13:55 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-29 19:13:55 +0100 |
commit | eec67a675f7ea3545bfba79c6b753f63f7fd9b3b (patch) | |
tree | 3f21a7efafb131bd76848cdc50ce574edb95fd2f /synapse/handlers/presence.py | |
parent | Bugfix for rest presence test - datastore needs to implement profile methods (diff) | |
download | synapse-eec67a675f7ea3545bfba79c6b753f63f7fd9b3b.tar.xz |
Have EventSource's get_new_events_for_user() API work only on keys within that source, not overall eventstream tokens
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r-- | synapse/handlers/presence.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 1d3b02a9db..05bf145240 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -727,8 +727,8 @@ class PresenceEventSource(object): self.hs = hs self.clock = hs.get_clock() - def get_new_events_for_user(self, user, from_token, limit): - from_key = int(from_token.presence_key) + def get_new_events_for_user(self, user, from_key, limit): + from_key = int(from_key) presence = self.hs.get_handlers().presence_handler cachemap = presence._user_cachemap @@ -743,15 +743,9 @@ class PresenceEventSource(object): latest_serial = max([x[1].serial for x in updates]) data = [x[1].make_event(user=x[0], clock=clock) for x in updates] - end_token = from_token.copy_and_replace( - "presence_key", latest_serial - ) - return ((data, end_token)) + return ((data, latest_serial)) else: - end_token = from_token.copy_and_replace( - "presence_key", presence._user_cachemap_latest_serial - ) - return (([], end_token)) + return (([], presence._user_cachemap_latest_serial)) def get_current_token_part(self): presence = self.hs.get_handlers().presence_handler |