summary refs log tree commit diff
path: root/synapse/handlers/devicemessage.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-05-27 07:14:36 -0400
committerGitHub <noreply@github.com>2022-05-27 07:14:36 -0400
commitc52abc1cfdd9e5480cdb4a03d626fe61cacc6573 (patch)
tree0859f49a5d1e69ce8c844ba9d785c67a2a747854 /synapse/handlers/devicemessage.py
parentRemove federation client code for groups. (#12563) (diff)
downloadsynapse-c52abc1cfdd9e5480cdb4a03d626fe61cacc6573.tar.xz
Additional constants for EDU types. (#12884)
Instead of hard-coding strings in many places.
Diffstat (limited to 'synapse/handlers/devicemessage.py')
-rw-r--r--synapse/handlers/devicemessage.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/devicemessage.py b/synapse/handlers/devicemessage.py
index 53668cce3b..444c08bc2e 100644
--- a/synapse/handlers/devicemessage.py
+++ b/synapse/handlers/devicemessage.py
@@ -15,7 +15,7 @@
 import logging
 from typing import TYPE_CHECKING, Any, Dict
 
-from synapse.api.constants import ToDeviceEventTypes
+from synapse.api.constants import EduTypes, ToDeviceEventTypes
 from synapse.api.errors import SynapseError
 from synapse.api.ratelimiting import Ratelimiter
 from synapse.logging.context import run_in_background
@@ -59,11 +59,11 @@ class DeviceMessageHandler:
         # to the appropriate worker.
         if hs.get_instance_name() in hs.config.worker.writers.to_device:
             hs.get_federation_registry().register_edu_handler(
-                "m.direct_to_device", self.on_direct_to_device_edu
+                EduTypes.DIRECT_TO_DEVICE, self.on_direct_to_device_edu
             )
         else:
             hs.get_federation_registry().register_instances_for_edu(
-                "m.direct_to_device",
+                EduTypes.DIRECT_TO_DEVICE,
                 hs.config.worker.writers.to_device,
             )