From 61f49ecf0e09677cb1a82c8554ae26c0e3e1b1ca Mon Sep 17 00:00:00 2001 From: strawberry Date: Mon, 18 Mar 2024 21:17:05 -0400 Subject: [PATCH] rename forbidden_room_names to forbidden_alias_names Signed-off-by: strawberry --- conduwuit-example.toml | 2 +- src/api/client_server/alias.rs | 2 +- src/api/client_server/room.rs | 4 ++-- src/config/mod.rs | 6 +++--- src/database/mod.rs | 2 +- src/service/globals/mod.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) 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 }