From 341d956ee643567ab3a53f5626b38ace4826bf67 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 9 Jun 2025 11:59:49 +0100 Subject: [PATCH] Default to `public` join rule in remote summary (#18493) See: https://github.com/element-hq/synapse/issues/18358#issuecomment-2866119550 --- changelog.d/18493.bugfix | 1 + synapse/handlers/room_summary.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/18493.bugfix diff --git a/changelog.d/18493.bugfix b/changelog.d/18493.bugfix new file mode 100644 index 000000000..a4fab75e6 --- /dev/null +++ b/changelog.d/18493.bugfix @@ -0,0 +1 @@ +Fixed room summary API incorrectly returning that a room is private in the room summary response when the join rule is omitted by the remote server. Contributed by @nexy7574. diff --git a/synapse/handlers/room_summary.py b/synapse/handlers/room_summary.py index 64f5bea01..91b131d09 100644 --- a/synapse/handlers/room_summary.py +++ b/synapse/handlers/room_summary.py @@ -701,7 +701,7 @@ class RoomSummaryHandler: # The API doesn't return the room version so assume that a # join rule of knock is valid. if ( - room.get("join_rule") + room.get("join_rule", JoinRules.PUBLIC) in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED) or room.get("world_readable") is True ):