From bef7fb88c520873fe0c999a590ce4724e4963148 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 18 Nov 2020 01:22:49 +0200 Subject: [PATCH] Allow specific users to add aliases with whitespace --- synapse/handlers/directory.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index ad5683d25..7d8d9e22b 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -64,9 +64,11 @@ class DirectoryHandler(BaseHandler): ): # general association creation for both human users and app services - for wchar in string.whitespace: - if wchar in room_alias.localpart: - raise SynapseError(400, "Invalid characters in room alias") + # meow: allow specific users to include anything in room aliases + if creator not in self.config.meow.validation_override: + for wchar in string.whitespace: + if wchar in room_alias.localpart: + raise SynapseError(400, "Invalid characters in room alias") if not self.hs.is_mine(room_alias): raise SynapseError(400, "Room alias must be local")