mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 18:04:13 -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
|
@ -26,7 +26,7 @@ from synapse.logging.opentracing import (
|
|||
set_tag,
|
||||
)
|
||||
from synapse.replication.http.devices import ReplicationUserDevicesResyncRestServlet
|
||||
from synapse.types import JsonDict, Requester, UserID, get_domain_from_id
|
||||
from synapse.types import JsonDict, Requester, StreamKeyType, UserID, get_domain_from_id
|
||||
from synapse.util import json_encoder
|
||||
from synapse.util.stringutils import random_string
|
||||
|
||||
|
@ -151,7 +151,7 @@ class DeviceMessageHandler:
|
|||
# Notify listeners that there are new to-device messages to process,
|
||||
# handing them the latest stream id.
|
||||
self.notifier.on_new_event(
|
||||
"to_device_key", last_stream_id, users=local_messages.keys()
|
||||
StreamKeyType.TO_DEVICE, last_stream_id, users=local_messages.keys()
|
||||
)
|
||||
|
||||
async def _check_for_unknown_devices(
|
||||
|
@ -285,7 +285,7 @@ class DeviceMessageHandler:
|
|||
# Notify listeners that there are new to-device messages to process,
|
||||
# handing them the latest stream id.
|
||||
self.notifier.on_new_event(
|
||||
"to_device_key", last_stream_id, users=local_messages.keys()
|
||||
StreamKeyType.TO_DEVICE, last_stream_id, users=local_messages.keys()
|
||||
)
|
||||
|
||||
if self.federation_sender:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue