From 918070c51232eb4bf99a452f519d1690e1bd97a5 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Fri, 14 Aug 2026 12:20:12 +0200 Subject: [PATCH] fix(spaces): Expose restricted children over federation --- changelog.d/2132.bugfix.md | 1 + src/service/rooms/summary/mod.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 changelog.d/2132.bugfix.md diff --git a/changelog.d/2132.bugfix.md b/changelog.d/2132.bugfix.md new file mode 100644 index 000000000..770e486ed --- /dev/null +++ b/changelog.d/2132.bugfix.md @@ -0,0 +1 @@ +Fixed federated space hierarchies omitting rooms restricted to members of private spaces. Contributed by @eleboucher. diff --git a/src/service/rooms/summary/mod.rs b/src/service/rooms/summary/mod.rs index b3bd9e350..1fe5cbb02 100644 --- a/src/service/rooms/summary/mod.rs +++ b/src/service/rooms/summary/mod.rs @@ -598,6 +598,23 @@ impl Service { return true; } + // For restricted rooms, federation responses must include the summary when + // a user on the querying server can satisfy one of the join conditions. + if let JoinRuleSummary::Restricted(RestrictedSummary { allowed_room_ids, .. }) = + &summary.join_rule + { + for room_id in allowed_room_ids { + if self + .services + .state_cache + .server_in_room(querying_server, room_id) + .await + { + return true; + } + } + } + // If the server isn't in the room, the same visibility rules apply as for // anonymous summary requests. self.user_may_see_summary(None, summary).await