Skip to content

Commit

Permalink
Fix lint and typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
kfiven authored May 17, 2024
1 parent 1569c95 commit 5319532
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions synapse/handlers/room_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ async def _get_room_hierarchy(

# First of all, check that the room is accessible locally.
# OR accessible through federation.
local_room = await self._store.is_host_joined(room_id, self._server_name)
if local_room and not await self._is_local_room_accessible(requested_room_id, requester):
local_room = await self._store.is_host_joined(
requested_room_id, self._server_name
)
if local_room and not await self._is_local_room_accessible(
requested_room_id, requester
):
raise UnstableSpecAuthError(
403,
"User %s not in room %s, and room previews are disabled"
Expand All @@ -195,15 +199,14 @@ async def _get_room_hierarchy(
)

if not local_room:
(
room_entry,
children_room_entries,
inaccessible_children,
) = await self._summarize_remote_room_hierarchy(
room_hierarchy = await self._summarize_remote_room_hierarchy(
_RoomQueueEntry(requested_room_id, ()),
False,
)
if not room_entry or not await self._is_remote_room_accessible(requester, requested_room_id, room_entry.room):
root_room_entry = room_hierarchy[0]
if not root_room_entry or not await self._is_remote_room_accessible(
requester, requested_room_id, root_room_entry.room
):
raise UnstableSpecAuthError(
403,
"User %s not in room %s, and room previews are disabled"
Expand Down

0 comments on commit 5319532

Please sign in to comment.