feat: Forbid suspended users from sending state events
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 4s
Release Docker Image / define-variables (push) Failing after 2s
Release Docker Image / build-image (linux/amd64, release, linux-amd64, base) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, release, linux-arm64, base) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Checks / Rust / Format (push) Failing after 8s
Checks / Rust / Clippy (push) Failing after 13s
Checks / Rust / Cargo Test (push) Failing after 14s

This commit is contained in:
nexy7574 2025-06-28 21:30:07 +01:00
parent 13ba3f278f
commit a6ceaa8259
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F

View file

@ -33,6 +33,10 @@ pub(crate) async fn send_state_event_for_key_route(
) -> Result<send_state_event::v3::Response> {
let sender_user = body.sender_user();
if services.users.is_suspended(sender_user).await? {
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
}
Ok(send_state_event::v3::Response {
event_id: send_state_event_for_key_helper(
&services,