mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 04:24:59 -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
|
@ -46,6 +46,7 @@ from synapse.types import (
|
|||
JsonDict,
|
||||
PersistedEventPosition,
|
||||
RoomStreamToken,
|
||||
StreamKeyType,
|
||||
StreamToken,
|
||||
UserID,
|
||||
)
|
||||
|
@ -370,7 +371,7 @@ class Notifier:
|
|||
|
||||
if users or rooms:
|
||||
self.on_new_event(
|
||||
"room_key",
|
||||
StreamKeyType.ROOM,
|
||||
max_room_stream_token,
|
||||
users=users,
|
||||
rooms=rooms,
|
||||
|
@ -440,7 +441,7 @@ class Notifier:
|
|||
for room in rooms:
|
||||
user_streams |= self.room_to_user_streams.get(room, set())
|
||||
|
||||
if stream_key == "to_device_key":
|
||||
if stream_key == StreamKeyType.TO_DEVICE:
|
||||
issue9533_logger.debug(
|
||||
"to-device messages stream id %s, awaking streams for %s",
|
||||
new_token,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue