fix: Deserialisation error breaks logins

This commit is contained in:
timedout 2026-01-25 04:22:43 +00:00
parent 655eacfa7b
commit ca51993ee3
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F
3 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@ use axum_client_ip::InsecureClientIp;
use conduwuit::{
Err, Result,
debug::DebugInspect,
debug_info, err, info,
debug_info, err,
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
warn,
};
@ -297,7 +297,7 @@ pub(crate) async fn redact_media_route(
media_id: &body.media_id,
};
if !services.media.user_owns(&user, &mxc).await {
if !services.media.user_owns(user, &mxc).await {
return Err!(Request(Forbidden("You do not have permission to redact this attachment.")));
}

View file

@ -310,7 +310,7 @@ impl Data {
pub(super) fn add_interested_server_name(&self, media_id: &str, server_name: &str) {
let key = (media_id, server_name);
self.mediaid_interestedservername
.insert(&database::serialize_key(&key).expect("key must be serializable"), []);
.insert(&database::serialize_key(key).expect("key must be serializable"), []);
}
pub(super) async fn interested_server_names(&self, media_id: &str) -> Vec<OwnedServerName> {

View file

@ -304,7 +304,7 @@ impl Service {
pub fn enable_login(&self, user_id: &UserId) { self.db.userid_logindisabled.remove(user_id); }
pub async fn is_login_disabled(&self, user_id: &UserId) -> bool {
self.db.userid_logindisabled.contains(user_id).await
self.db.userid_logindisabled.exists(user_id).await.is_ok()
}
/// Check if account is active, infallible