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/room.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/room.py')
-rw-r--r-- | synapse/handlers/room.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index b27bdecd43..ce15420bf4 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -469,22 +469,20 @@ class RoomEventSource(object): self.store = hs.get_datastore() @defer.inlineCallbacks - def get_new_events_for_user(self, user, from_token, limit): + def get_new_events_for_user(self, user, from_key, limit): # We just ignore the key for now. to_key = yield self.get_current_token_part() events, end_key = yield self.store.get_room_events_stream( user_id=user.to_string(), - from_key=from_token.room_key, + from_key=from_key, to_key=to_key, room_id=None, limit=limit, ) - end_token = from_token.copy_and_replace("room_key", end_key) - - defer.returnValue((events, end_token)) + defer.returnValue((events, end_key)) def get_current_token_part(self): return self.store.get_room_events_max_id() |