mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 09:54:50 -04:00
Add StreamKeyType
class and replace string literals with constants (#12567)
This commit is contained in:
parent
3ce15cc7be
commit
83be72d76c
19 changed files with 125 additions and 80 deletions
|
@ -30,6 +30,7 @@ from synapse.types import (
|
|||
Requester,
|
||||
RoomStreamToken,
|
||||
StateMap,
|
||||
StreamKeyType,
|
||||
StreamToken,
|
||||
UserID,
|
||||
)
|
||||
|
@ -220,8 +221,10 @@ class InitialSyncHandler:
|
|||
self.storage, user_id, messages
|
||||
)
|
||||
|
||||
start_token = now_token.copy_and_replace("room_key", token)
|
||||
end_token = now_token.copy_and_replace("room_key", room_end_token)
|
||||
start_token = now_token.copy_and_replace(StreamKeyType.ROOM, token)
|
||||
end_token = now_token.copy_and_replace(
|
||||
StreamKeyType.ROOM, room_end_token
|
||||
)
|
||||
time_now = self.clock.time_msec()
|
||||
|
||||
d["messages"] = {
|
||||
|
@ -369,8 +372,8 @@ class InitialSyncHandler:
|
|||
self.storage, user_id, messages, is_peeking=is_peeking
|
||||
)
|
||||
|
||||
start_token = StreamToken.START.copy_and_replace("room_key", token)
|
||||
end_token = StreamToken.START.copy_and_replace("room_key", stream_token)
|
||||
start_token = StreamToken.START.copy_and_replace(StreamKeyType.ROOM, token)
|
||||
end_token = StreamToken.START.copy_and_replace(StreamKeyType.ROOM, stream_token)
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
|
||||
|
@ -474,7 +477,7 @@ class InitialSyncHandler:
|
|||
self.storage, user_id, messages, is_peeking=is_peeking
|
||||
)
|
||||
|
||||
start_token = now_token.copy_and_replace("room_key", token)
|
||||
start_token = now_token.copy_and_replace(StreamKeyType.ROOM, token)
|
||||
end_token = now_token
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue