check if custom room ID is apart of forbidden room alias

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-02-08 19:13:01 -05:00 committed by June
parent fc93b29abe
commit d4d8c6eb21

View file

@ -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('"', "")
+ ":"