check if custom room ID is apart of forbidden room alias
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
@@ -90,6 +90,18 @@ pub async fn create_room_route(
|
||||
));
|
||||
}
|
||||
|
||||
// apply forbidden room alias checks to custom room IDs too
|
||||
if services()
|
||||
.globals
|
||||
.forbidden_room_names()
|
||||
.is_match(&custom_room_id_s)
|
||||
{
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Unknown,
|
||||
"Custom room ID is forbidden.",
|
||||
));
|
||||
}
|
||||
|
||||
let full_room_id = "!".to_owned()
|
||||
+ &custom_room_id_s.replace('"', "")
|
||||
+ ":"
|
||||
|
||||
Reference in New Issue
Block a user