mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-17 17:49:15 -04:00
Clean up types for PaginationConfig (#8250)
This removes `SourcePaginationConfig` and `get_pagination_rows`. The reasoning behind this is that these generic classes/functions erased the types of the IDs it used (i.e. instead of passing around `StreamToken` it'd pass in e.g. `token.room_key`, which don't have uniform types).
This commit is contained in:
parent
703e2b8a96
commit
0f545e6b96
7 changed files with 52 additions and 86 deletions
|
@ -116,14 +116,13 @@ class InitialSyncHandler(BaseHandler):
|
|||
now_token = self.hs.get_event_sources().get_current_token()
|
||||
|
||||
presence_stream = self.hs.get_event_sources().sources["presence"]
|
||||
pagination_config = PaginationConfig(from_token=now_token)
|
||||
presence, _ = await presence_stream.get_pagination_rows(
|
||||
user, pagination_config.get_source_config("presence"), None
|
||||
presence, _ = await presence_stream.get_new_events(
|
||||
user, from_key=None, include_offline=False
|
||||
)
|
||||
|
||||
receipt_stream = self.hs.get_event_sources().sources["receipt"]
|
||||
receipt, _ = await receipt_stream.get_pagination_rows(
|
||||
user, pagination_config.get_source_config("receipt"), None
|
||||
joined_rooms = [r.room_id for r in room_list if r.membership == Membership.JOIN]
|
||||
receipt = await self.store.get_linearized_receipts_for_rooms(
|
||||
joined_rooms, to_key=int(now_token.receipt_key),
|
||||
)
|
||||
|
||||
tags_by_room = await self.store.get_tags_for_user(user_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue