summary refs log tree commit diff
path: root/synapse/handlers/state_deltas.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-01-26 10:50:21 -0500
committerGitHub <noreply@github.com>2021-01-26 10:50:21 -0500
commit1baab2035265cf2543fe3c0ef5412c1ac0740c7e (patch)
treecb1b9911d3ad794be081378031cfcdc72939f73f /synapse/handlers/state_deltas.py
parentDo not require the CAS service URL setting (use public_baseurl instead). (#9199) (diff)
downloadsynapse-1baab2035265cf2543fe3c0ef5412c1ac0740c7e.tar.xz
Add type hints to various handlers. (#9223)
With this change all handlers except the e2e_* ones have
type hints enabled.
Diffstat (limited to 'synapse/handlers/state_deltas.py')
-rw-r--r--synapse/handlers/state_deltas.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/handlers/state_deltas.py b/synapse/handlers/state_deltas.py
index fb4f70e8e2..b3f9875358 100644
--- a/synapse/handlers/state_deltas.py
+++ b/synapse/handlers/state_deltas.py
@@ -14,15 +14,25 @@
 # limitations under the License.
 
 import logging
+from typing import TYPE_CHECKING, Optional
+
+if TYPE_CHECKING:
+    from synapse.app.homeserver import HomeServer
 
 logger = logging.getLogger(__name__)
 
 
 class StateDeltasHandler:
-    def __init__(self, hs):
+    def __init__(self, hs: "HomeServer"):
         self.store = hs.get_datastore()
 
-    async def _get_key_change(self, prev_event_id, event_id, key_name, public_value):
+    async def _get_key_change(
+        self,
+        prev_event_id: Optional[str],
+        event_id: Optional[str],
+        key_name: str,
+        public_value: str,
+    ) -> Optional[bool]:
         """Given two events check if the `key_name` field in content changed
         from not matching `public_value` to doing so.