check if custom room ID is apart of forbidden room alias
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
fc93b29abe
commit
d4d8c6eb21
1 changed files with 12 additions and 0 deletions
|
@ -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()
|
let full_room_id = "!".to_owned()
|
||||||
+ &custom_room_id_s.replace('"', "")
|
+ &custom_room_id_s.replace('"', "")
|
||||||
+ ":"
|
+ ":"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue