diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-06-05 14:42:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 14:42:55 -0400 |
commit | 737b4a936e35daaa839e7296d888041941546b47 (patch) | |
tree | 54bf774f1dca24f5826032403a194972c24d756f /synapse/handlers/state_deltas.py | |
parent | Add an option to disable autojoin for guest accounts (#6637) (diff) | |
download | synapse-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.py | 9 |
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) |