summary refs log tree commit diff
path: root/synapse/handlers/presence.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/presence.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/presence.py')
-rw-r--r--synapse/handlers/presence.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index dd84e6c88b..bf112b9e1e 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -49,7 +49,7 @@ from prometheus_client import Counter
 from typing_extensions import ContextManager
 
 import synapse.metrics
-from synapse.api.constants import EventTypes, Membership, PresenceState
+from synapse.api.constants import EduTypes, EventTypes, Membership, PresenceState
 from synapse.api.errors import SynapseError
 from synapse.api.presence import UserPresenceState
 from synapse.appservice import ApplicationService
@@ -394,7 +394,7 @@ class WorkerPresenceHandler(BasePresenceHandler):
 
         # Route presence EDUs to the right worker
         hs.get_federation_registry().register_instances_for_edu(
-            "m.presence",
+            EduTypes.PRESENCE,
             hs.config.worker.writers.presence,
         )
 
@@ -649,7 +649,9 @@ class PresenceHandler(BasePresenceHandler):
 
         federation_registry = hs.get_federation_registry()
 
-        federation_registry.register_edu_handler("m.presence", self.incoming_presence)
+        federation_registry.register_edu_handler(
+            EduTypes.PRESENCE, self.incoming_presence
+        )
 
         LaterGauge(
             "synapse_handlers_presence_user_to_current_state_size",