2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/18493.bugfix b/changelog.d/18493.bugfix
new file mode 100644
index 0000000000..a4fab75e69
--- /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 64f5bea014..91b131d09b 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
):
|