fix: Missing suspensions shouldn't error
Some checks failed
Checks / Prefligit / prefligit (push) Failing after 4s
Release Docker Image / define-variables (push) Failing after 11s
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 17s
Checks / Rust / Cargo Test (push) Failing after 15s

Turns out copying and pasting the function
above verbatim actually introduces more
problems than it solves!
This commit is contained in:
nexy7574 2025-06-29 01:52:02 +01:00
parent b3428c2e3d
commit c6ed641dcb
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F

View file

@ -2,7 +2,7 @@ use std::{collections::BTreeMap, mem, sync::Arc};
use conduwuit::{
Err, Error, Result, Server, at, debug_warn, err, trace,
utils::{self, ReadyExt, stream::TryIgnore, string::Unquoted},
utils::{self, ReadyExt, TryFutureExtExt, stream::TryIgnore, string::Unquoted},
};
use database::{Deserialized, Ignore, Interfix, Json, Map};
use futures::{Stream, StreamExt, TryFutureExt};
@ -176,8 +176,7 @@ impl Service {
self.db
.userid_suspended
.get(user_id)
.map_ok(|val| !val.is_empty())
.map_err(|_| err!(Request(NotFound("User does not exist."))))
.map_ok_or(Ok(false), |_| Ok(true))
.await
}