mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 17:54:48 -04:00
Initial hack at wiring together pagination and backfill
This commit is contained in:
parent
17653a5dfe
commit
84e6b4001f
3 changed files with 141 additions and 5 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue