mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Deserialisation error breaks logins
This commit is contained in:
@@ -5,7 +5,7 @@ use axum_client_ip::InsecureClientIp;
|
|||||||
use conduwuit::{
|
use conduwuit::{
|
||||||
Err, Result,
|
Err, Result,
|
||||||
debug::DebugInspect,
|
debug::DebugInspect,
|
||||||
debug_info, err, info,
|
debug_info, err,
|
||||||
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
utils::{self, content_disposition::make_content_disposition, math::ruma_from_usize},
|
||||||
warn,
|
warn,
|
||||||
};
|
};
|
||||||
@@ -297,7 +297,7 @@ pub(crate) async fn redact_media_route(
|
|||||||
media_id: &body.media_id,
|
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.")));
|
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) {
|
pub(super) fn add_interested_server_name(&self, media_id: &str, server_name: &str) {
|
||||||
let key = (media_id, server_name);
|
let key = (media_id, server_name);
|
||||||
self.mediaid_interestedservername
|
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> {
|
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 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 {
|
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
|
/// Check if account is active, infallible
|
||||||
|
|||||||
Reference in New Issue
Block a user