mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-30 00:04:34 +02:00
feat: Prevent suspended users sending events
This commit is contained in:
parent
fac9e090cd
commit
accfda2586
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,9 @@ pub(crate) async fn send_message_event_route(
|
|||
let sender_user = body.sender_user();
|
||||
let sender_device = body.sender_device.as_deref();
|
||||
let appservice_info = body.appservice_info.as_ref();
|
||||
if services.users.is_suspended(sender_user).await? {
|
||||
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
|
||||
}
|
||||
|
||||
// Forbid m.room.encrypted if encryption is disabled
|
||||
if MessageLikeEventType::RoomEncrypted == body.event_type && !services.config.allow_encryption
|
||||
|
|
Loading…
Add table
Reference in a new issue