summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-11-19 10:19:32 -0500
committerGitHub <noreply@github.com>2021-11-19 15:19:32 +0000
commit7ae559944af1b27e36a6f4423177f51d7b4b3826 (patch)
tree918c7e7c16ece961b57fa4dc1983bca7a33b6192 /synapse/handlers/room.py
parentRemove dead code from acme support. (#11393) (diff)
downloadsynapse-7ae559944af1b27e36a6f4423177f51d7b4b3826.tar.xz
Fix checking whether a room can be published on creation. (#11392)
If `room_list_publication_rules` was configured with a rule with a
non-wildcard alias and a room was created with an alias then an
internal server error would have been thrown.

This fixes the error and properly applies the publication rules
during room creation.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index f9a099c4f3..88053f9869 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -775,8 +775,11 @@ class RoomCreationHandler:
             raise SynapseError(403, "Room visibility value not allowed.")
 
         if is_public:
+            room_aliases = []
+            if room_alias:
+                room_aliases.append(room_alias.to_string())
             if not self.config.roomdirectory.is_publishing_room_allowed(
-                user_id, room_id, room_alias
+                user_id, room_id, room_aliases
             ):
                 # Let's just return a generic message, as there may be all sorts of
                 # reasons why we said no. TODO: Allow configurable error messages