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>2020-06-05 14:42:55 -0400
committerGitHub <noreply@github.com>2020-06-05 14:42:55 -0400
commit737b4a936e35daaa839e7296d888041941546b47 (patch)
tree54bf774f1dca24f5826032403a194972c24d756f /synapse/handlers/state_deltas.py
parentAdd an option to disable autojoin for guest accounts (#6637) (diff)
downloadsynapse-737b4a936e35daaa839e7296d888041941546b47.tar.xz
Convert user directory handler and related classes to async/await. (#7640)
Diffstat (limited to 'synapse/handlers/state_deltas.py')
-rw-r--r--synapse/handlers/state_deltas.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/handlers/state_deltas.py b/synapse/handlers/state_deltas.py
index f065970c40..8590c1eff4 100644
--- a/synapse/handlers/state_deltas.py
+++ b/synapse/handlers/state_deltas.py
@@ -15,8 +15,6 @@
 
 import logging
 
-from twisted.internet import defer
-
 logger = logging.getLogger(__name__)
 
 
@@ -24,8 +22,7 @@ class StateDeltasHandler(object):
     def __init__(self, hs):
         self.store = hs.get_datastore()
 
-    @defer.inlineCallbacks
-    def _get_key_change(self, prev_event_id, event_id, key_name, public_value):
+    async def _get_key_change(self, prev_event_id, event_id, key_name, public_value):
         """Given two events check if the `key_name` field in content changed
         from not matching `public_value` to doing so.
 
@@ -41,10 +38,10 @@ class StateDeltasHandler(object):
         prev_event = None
         event = None
         if prev_event_id:
-            prev_event = yield self.store.get_event(prev_event_id, allow_none=True)
+            prev_event = await self.store.get_event(prev_event_id, allow_none=True)
 
         if event_id:
-            event = yield self.store.get_event(event_id, allow_none=True)
+            event = await self.store.get_event(event_id, allow_none=True)
 
         if not event and not prev_event:
             logger.debug("Neither event exists: %r %r", prev_event_id, event_id)