diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 089088f4..d1163874 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -173,7 +173,7 @@ registration_token = "change this token for something specific to your server" # This is checked upon room alias creation, custom room ID creation if used, and startup as warnings if any room aliases # in your database have a forbidden room alias/ID. # No default. -# forbidden_room_names = [] +# forbidden_alias_names = [] # Set this to true to allow your server's public room directory to be federated. # Set this to false to protect against /publicRooms spiders, but will forbid external users diff --git a/src/api/client_server/alias.rs b/src/api/client_server/alias.rs index be4a8ed0..dc37c3a7 100644 --- a/src/api/client_server/alias.rs +++ b/src/api/client_server/alias.rs @@ -21,7 +21,7 @@ pub async fn create_alias_route(body: Ruma) -> Result return Err(Error::BadRequest(ErrorKind::InvalidParam, "Alias is from another server.")); } - if services().globals.forbidden_room_names().is_match(body.room_alias.alias()) { + if services().globals.forbidden_alias_names().is_match(body.room_alias.alias()) { return Err(Error::BadRequest(ErrorKind::Unknown, "Room alias is forbidden.")); } diff --git a/src/api/client_server/room.rs b/src/api/client_server/room.rs index a6e667d7..843cf0ed 100644 --- a/src/api/client_server/room.rs +++ b/src/api/client_server/room.rs @@ -80,7 +80,7 @@ pub async fn create_room_route(body: Ruma) -> Result) -> Result { pub fn url_preview_check_root_domain(&self) -> bool { self.config.url_preview_check_root_domain } - pub fn forbidden_room_names(&self) -> &RegexSet { &self.config.forbidden_room_names } + pub fn forbidden_alias_names(&self) -> &RegexSet { &self.config.forbidden_alias_names } pub fn forbidden_usernames(&self) -> &RegexSet { &self.config.forbidden_usernames }