feat: Prevent suspended users creating new rooms

This commit is contained in:
nexy7574 2025-06-28 20:47:02 +01:00 committed by Ellis Git
parent e127c4e5a2
commit 5d5350a9fe

View file

@ -70,6 +70,10 @@ pub(crate) async fn create_room_route(
));
}
if services.users.is_suspended(sender_user).await? {
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
}
let room_id: OwnedRoomId = match &body.room_id {
| Some(custom_room_id) => custom_room_id_check(&services, custom_room_id)?,
| _ => RoomId::new(&services.server.name),