Implement message forward pagination from start when no from is given, fixes #12383 (#14149)

Fixes https://github.com/matrix-org/synapse/issues/12383
This commit is contained in:
Benjamin Kampmann 2022-11-24 09:10:51 +00:00 committed by GitHub
parent 9af2be192a
commit f6c74d1cb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 0 deletions

View file

@ -73,6 +73,19 @@ class EventSources:
)
return token
@trace
async def get_start_token_for_pagination(self, room_id: str) -> StreamToken:
"""Get the start token for a given room to be used to paginate
events.
The returned token does not have the current values for fields other
than `room`, since they are not used during pagination.
Returns:
The start token for pagination.
"""
return StreamToken.START
@trace
async def get_current_token_for_pagination(self, room_id: str) -> StreamToken:
"""Get the current token for a given room to be used to paginate