check if invited user is an admin before rejecting instead

i think this makes more sense tbh than what synapse does

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-02 21:54:16 -05:00 committed by June
parent 34e8fd38cf
commit 608aa83ed2
4 changed files with 16 additions and 12 deletions

View file

@ -201,7 +201,9 @@ pub async fn invite_user_route(
));
}
if services().rooms.metadata.is_banned(&body.room_id)? && !services().users.is_admin(sender_user)? {
if services().rooms.metadata.is_banned(&body.room_id)?
&& !services().users.is_admin(sender_user)?
{
info!(
"Local user {} who is not an admin attempted to send an invite for banned room {}.",
&sender_user, &body.room_id