diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2022-05-16 16:35:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 15:35:31 +0000 |
commit | 83be72d76ca171ceb0fc381aa4548c1d9fea0dc7 (patch) | |
tree | c7d4fee54f2b7ba7993c15b6d892d9579da3d91b /synapse/notifier.py | |
parent | Avoid unnecessary copies when filtering private read receipts. (#12711) (diff) | |
download | synapse-83be72d76ca171ceb0fc381aa4548c1d9fea0dc7.tar.xz |
Add `StreamKeyType` class and replace string literals with constants (#12567)
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py index 01a50b9d62..ba23257f54 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -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, |