summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-04-14 17:06:06 +0100
committerGitHub <noreply@github.com>2021-04-14 17:06:06 +0100
commit00a6db967655daf1d6db290b7e0d2bb53827ade9 (patch)
tree154989bf3a764542ba34147a6b27758dde7b1560 /synapse/server.py
parentMore robust handling of the Content-Type header for thumbnail generation (#9788) (diff)
downloadsynapse-00a6db967655daf1d6db290b7e0d2bb53827ade9.tar.xz
Move some replication processing out of generic_worker (#9796)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 6c35ae6e50..95a2cd2e5d 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -85,7 +85,11 @@ from synapse.handlers.initial_sync import InitialSyncHandler
 from synapse.handlers.message import EventCreationHandler, MessageHandler
 from synapse.handlers.pagination import PaginationHandler
 from synapse.handlers.password_policy import PasswordPolicyHandler
-from synapse.handlers.presence import PresenceHandler
+from synapse.handlers.presence import (
+    BasePresenceHandler,
+    PresenceHandler,
+    WorkerPresenceHandler,
+)
 from synapse.handlers.profile import ProfileHandler
 from synapse.handlers.read_marker import ReadMarkerHandler
 from synapse.handlers.receipts import ReceiptsHandler
@@ -415,8 +419,11 @@ class HomeServer(metaclass=abc.ABCMeta):
         return StateResolutionHandler(self)
 
     @cache_in_self
-    def get_presence_handler(self) -> PresenceHandler:
-        return PresenceHandler(self)
+    def get_presence_handler(self) -> BasePresenceHandler:
+        if self.config.worker_app:
+            return WorkerPresenceHandler(self)
+        else:
+            return PresenceHandler(self)
 
     @cache_in_self
     def get_typing_writer_handler(self) -> TypingWriterHandler: