summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-03-24 15:03:59 +0000
committerErik Johnston <erik@matrix.org>2020-03-24 15:03:59 +0000
commit11fb08ffa916b50494fd8c1bb4a6e49b8547ed78 (patch)
tree1d1b4b15792446bd5a57278d677c819e44b27f69 /synapse
parentMove command processing out of transport (diff)
downloadsynapse-11fb08ffa916b50494fd8c1bb4a6e49b8547ed78.tar.xz
mypy
Diffstat (limited to 'synapse')
-rw-r--r--synapse/replication/tcp/handler.py10
-rw-r--r--synapse/server.pyi2
2 files changed, 7 insertions, 5 deletions
diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py
index a59ab01471..b620b29dfb 100644
--- a/synapse/replication/tcp/handler.py
+++ b/synapse/replication/tcp/handler.py
@@ -17,7 +17,7 @@
 """
 
 import logging
-from typing import Any, Dict, List
+from typing import Any, Callable, Dict, List
 
 from prometheus_client import Counter
 
@@ -63,7 +63,7 @@ class ReplicationClientHandler:
         self.presence_handler = hs.get_presence_handler()
         self.instance_id = hs.get_instance_id()
 
-        self.connections = []
+        self.connections = []  # type: List[Any]
 
         self.streams = {
             stream.NAME: stream(hs) for stream in STREAMS_MAP.values()
@@ -186,6 +186,8 @@ class ReplicationClientHandler:
                 cmd.device_id,
                 cmd.last_seen,
             )
+
+        if self._server_notices_sender:
             await self._server_notices_sender.on_user_ip(cmd.user_id)
 
     async def on_RDATA(self, cmd: RdataCommand):
@@ -259,7 +261,7 @@ class ReplicationClientHandler:
     async def on_REMOTE_SERVER_UP(self, cmd: RemoteServerUpCommand):
         """Called when get a new REMOTE_SERVER_UP command."""
         if self.is_master:
-            self.notifier.notify_remote_server_up(cmd.server)
+            self.notifier.notify_remote_server_up(cmd.data)
 
     def get_currently_syncing_users(self):
         """Get the list of currently syncing users (if any). This is called
@@ -296,7 +298,7 @@ class ReplicationClientHandler:
         cmd = RemovePusherCommand(app_id, push_key, user_id)
         self.send_command(cmd)
 
-    def send_invalidate_cache(self, cache_func: str, keys: tuple):
+    def send_invalidate_cache(self, cache_func: Callable, keys: tuple):
         """Poke the master to invalidate a cache.
         """
         cmd = InvalidateCacheCommand(cache_func.__name__, keys)
diff --git a/synapse/server.pyi b/synapse/server.pyi
index 9d1dfa71e7..6bb37dec9c 100644
--- a/synapse/server.pyi
+++ b/synapse/server.pyi
@@ -106,7 +106,7 @@ class HomeServer(object):
         pass
     def get_tcp_replication(
         self,
-    ) -> synapse.replication.tcp.client.ReplicationClientHandler:
+    ) -> synapse.replication.tcp.handler.ReplicationClientHandler:
         pass
     def get_federation_registry(
         self,