diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-05-05 18:14:00 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-05-05 18:14:00 +0100 |
commit | 13dd458b8ddb248a84f5cf0c063e6002c831d72a (patch) | |
tree | c29b804da054820a6c0ed1d59d0159e620862093 /synapse/notifier.py | |
parent | Update changelog.d/7423.misc (diff) | |
parent | Add backwards compatibility codepath to LoggingContext. (#7408) (diff) | |
download | synapse-13dd458b8ddb248a84f5cf0c063e6002c831d72a.tar.xz |
Merge branch 'release-v1.13.0' into erikj/faster_device_lists_fetch
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py index 88a5a97caf..71d9ed62b0 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -273,10 +273,9 @@ class Notifier(object): "room_key", room_stream_id, users=extra_users, rooms=[event.room_id] ) - @defer.inlineCallbacks - def _notify_app_services(self, room_stream_id): + async def _notify_app_services(self, room_stream_id): try: - yield self.appservice_handler.notify_interested_services(room_stream_id) + await self.appservice_handler.notify_interested_services(room_stream_id) except Exception: logger.exception("Error notifying application services of event") @@ -475,20 +474,18 @@ class Notifier(object): return result - @defer.inlineCallbacks - def _get_room_ids(self, user, explicit_room_id): - joined_room_ids = yield self.store.get_rooms_for_user(user.to_string()) + async def _get_room_ids(self, user, explicit_room_id): + joined_room_ids = await self.store.get_rooms_for_user(user.to_string()) if explicit_room_id: if explicit_room_id in joined_room_ids: return [explicit_room_id], True - if (yield self._is_world_readable(explicit_room_id)): + if await self._is_world_readable(explicit_room_id): return [explicit_room_id], False raise AuthError(403, "Non-joined access not allowed") return joined_room_ids, True - @defer.inlineCallbacks - def _is_world_readable(self, room_id): - state = yield self.state_handler.get_current_state( + async def _is_world_readable(self, room_id): + state = await self.state_handler.get_current_state( room_id, EventTypes.RoomHistoryVisibility, "" ) if state and "history_visibility" in state.content: |