diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-11 18:01:31 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-11 18:01:31 +0100 |
commit | 84e6b4001f22b0e8c2f806053189fcdb1e85205b (patch) | |
tree | ade52ca08e4af76b9f4c361bdbb3b2e0ebc15db7 /synapse/handlers/message.py | |
parent | Move storage.stream._StreamToken to types.RoomStreamToken (diff) | |
download | synapse-84e6b4001f22b0e8c2f806053189fcdb1e85205b.tar.xz |
Initial hack at wiring together pagination and backfill
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 22e19af17f..38e375f86a 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -21,7 +21,7 @@ from synapse.streams.config import PaginationConfig from synapse.events.utils import serialize_event from synapse.events.validator import EventValidator from synapse.util.logcontext import PreserveLoggingContext -from synapse.types import UserID +from synapse.types import UserID, RoomStreamToken from ._base import BaseHandler @@ -92,6 +92,14 @@ class MessageHandler(BaseHandler): yield self.hs.get_event_sources().get_current_token() ) + room_token = RoomStreamToken.parse(pagin_config.from_token.room_key) + if room_token.topological is None: + raise SynapseError(400, "Invalid token") + + yield self.hs.get_handlers().federation_handler.maybe_backfill( + room_id, room_token.topological + ) + user = UserID.from_string(user_id) events, next_key = yield data_source.get_pagination_rows( |