Skip to content

Commit 5319532

Browse files
authored
Fix lint and typecheck
1 parent 1569c95 commit 5319532

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

synapse/handlers/room_summary.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,12 @@ async def _get_room_hierarchy(
185185

186186
# First of all, check that the room is accessible locally.
187187
# OR accessible through federation.
188-
local_room = await self._store.is_host_joined(room_id, self._server_name)
189-
if local_room and not await self._is_local_room_accessible(requested_room_id, requester):
188+
local_room = await self._store.is_host_joined(
189+
requested_room_id, self._server_name
190+
)
191+
if local_room and not await self._is_local_room_accessible(
192+
requested_room_id, requester
193+
):
190194
raise UnstableSpecAuthError(
191195
403,
192196
"User %s not in room %s, and room previews are disabled"
@@ -195,15 +199,14 @@ async def _get_room_hierarchy(
195199
)
196200

197201
if not local_room:
198-
(
199-
room_entry,
200-
children_room_entries,
201-
inaccessible_children,
202-
) = await self._summarize_remote_room_hierarchy(
202+
room_hierarchy = await self._summarize_remote_room_hierarchy(
203203
_RoomQueueEntry(requested_room_id, ()),
204204
False,
205205
)
206-
if not room_entry or not await self._is_remote_room_accessible(requester, requested_room_id, room_entry.room):
206+
root_room_entry = room_hierarchy[0]
207+
if not root_room_entry or not await self._is_remote_room_accessible(
208+
requester, requested_room_id, root_room_entry.room
209+
):
207210
raise UnstableSpecAuthError(
208211
403,
209212
"User %s not in room %s, and room previews are disabled"

0 commit comments

Comments
 (0)