fix: Deserialisation error breaks logins
This commit is contained in:
parent
655eacfa7b
commit
ca51993ee3
3 changed files with 4 additions and 4 deletions
|
|
@ -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.")));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue