mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-30 07:44:28 +02:00
feat: Prevent suspended users upgrading rooms
This commit is contained in:
parent
8e06571e7c
commit
08527a2880
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,7 @@ use std::cmp::max;
|
||||||
|
|
||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Error, Result, err, info,
|
Err, Error, Result, err, info,
|
||||||
matrix::{StateKey, pdu::PduBuilder},
|
matrix::{StateKey, pdu::PduBuilder},
|
||||||
};
|
};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
@ -63,6 +63,10 @@ pub(crate) async fn upgrade_room_route(
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if services.users.is_suspended(sender_user).await? {
|
||||||
|
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
|
||||||
|
}
|
||||||
|
|
||||||
// Create a replacement room
|
// Create a replacement room
|
||||||
let replacement_room = RoomId::new(services.globals.server_name());
|
let replacement_room = RoomId::new(services.globals.server_name());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue