feat: forbid certain usernames & room aliases

squashed from https://gitlab.com/famedly/conduit/-/merge_requests/582

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-02-08 19:11:48 -05:00 committed by June
parent 784d307425
commit fc93b29abe
8 changed files with 143 additions and 1 deletions

View file

@ -26,6 +26,17 @@ pub async fn create_alias_route(
));
}
if services()
.globals
.forbidden_room_names()
.is_match(body.room_alias.alias())
{
return Err(Error::BadRequest(
ErrorKind::Unknown,
"Room alias is forbidden.",
));
}
if services()
.rooms
.alias