mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:55:04 -04:00
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.
This commit is contained in:
parent
4d6d38ac2f
commit
7ae559944a
4 changed files with 98 additions and 59 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue