Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract server from roomId to get hierarchy over federation #17750

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/17750.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix hierarchy returning 403 when room is accessible through federation. Contributed by Krishan (@kfiven).
6 changes: 4 additions & 2 deletions synapse/handlers/room_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ async def _get_room_hierarchy(
)

if not local_room:
destination = requested_room_id.split(":", 1)[-1]
room_hierarchy = await self._summarize_remote_room_hierarchy(
_RoomQueueEntry(requested_room_id, ()),
_RoomQueueEntry(requested_room_id, [destination]),
False,
)
root_room_entry = room_hierarchy[0]
Expand Down Expand Up @@ -240,7 +241,8 @@ async def _get_room_hierarchy(
processed_rooms = set(pagination_session["processed_rooms"])
else:
# The queue of rooms to process, the next room is last on the stack.
room_queue = [_RoomQueueEntry(requested_room_id, ())]
destination = requested_room_id.split(":", 1)[-1]
room_queue = [_RoomQueueEntry(requested_room_id, [destination])]

# Rooms we have already processed.
processed_rooms = set()
Expand Down
Loading