mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-13 11:37:39 +02:00
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
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:
parent
13ba3f278f
commit
a6ceaa8259
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,10 @@ pub(crate) async fn send_state_event_for_key_route(
|
||||||
) -> Result<send_state_event::v3::Response> {
|
) -> Result<send_state_event::v3::Response> {
|
||||||
let sender_user = body.sender_user();
|
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 {
|
Ok(send_state_event::v3::Response {
|
||||||
event_id: send_state_event_for_key_helper(
|
event_id: send_state_event_for_key_helper(
|
||||||
&services,
|
&services,
|
||||||
|
|
Loading…
Add table
Reference in a new issue