diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-10-29 15:57:23 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-10-29 16:16:01 +0000 |
commit | d6bcffa9294e0f45101e148e24c06a4faa5758ca (patch) | |
tree | 97875eac1e60bdee0a097e0693f227dc7781fc52 /synapse/handlers/room.py | |
parent | Remove redundant (and incorrect) presence pagination fetching code (diff) | |
download | synapse-d6bcffa9294e0f45101e148e24c06a4faa5758ca.tar.xz |
Construct a source-specific 'SourcePaginationConfig' to pass into get_pagination_rows; meaning each source doesn't have to care about its own name any more
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r-- | synapse/handlers/room.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 21ae03df0d..81ce1a5907 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -612,23 +612,14 @@ class RoomEventSource(object): return self.store.get_room_events_max_id() @defer.inlineCallbacks - def get_pagination_rows(self, user, pagination_config, key): - from_token = pagination_config.from_token - to_token = pagination_config.to_token - limit = pagination_config.limit - direction = pagination_config.direction - - to_key = to_token.room_key if to_token else None - + def get_pagination_rows(self, user, config, key): events, next_key = yield self.store.paginate_room_events( room_id=key, - from_key=from_token.room_key, - to_key=to_key, - direction=direction, - limit=limit, + from_key=config.from_key, + to_key=config.to_key, + direction=config.direction, + limit=config.limit, with_feedback=True ) - next_token = from_token.copy_and_replace("room_key", next_key) - - defer.returnValue((events, next_token)) + defer.returnValue((events, next_key)) |