wip: Room data purging

This commit is contained in:
timedout
2026-05-01 17:38:43 +01:00
parent 4a99de0d28
commit ca5b43c6bb
17 changed files with 265 additions and 43 deletions
+3 -2
View File
@@ -118,8 +118,9 @@ pub(crate) async fn get_content_thumbnail_route(
} = match fetch_thumbnail_meta(&services, &mxc, user, body.timeout_ms, &dim).await {
| Ok(meta) => meta,
| Err(conduwuit::Error::Io(e)) => match e.kind() {
| std::io::ErrorKind::NotFound =>
return Err!(Request(NotFound("Thumbnail not found."))),
| std::io::ErrorKind::NotFound => {
return Err!(Request(NotFound("Thumbnail not found.")));
},
| std::io::ErrorKind::PermissionDenied => {
error!("Permission denied when trying to read file: {e:?}");
return Err!(Request(Unknown("Unknown error when fetching thumbnail.")));
+3 -2
View File
@@ -375,7 +375,7 @@ async fn allowed_to_send_state_event(
},
}
},
| StateEventType::RoomMember =>
| StateEventType::RoomMember => {
match json.deserialize_as_unchecked::<RoomMemberEventContent>() {
| Ok(mut membership_content) => {
let Ok(state_key) = UserId::parse(state_key) else {
@@ -434,7 +434,8 @@ async fn allowed_to_send_state_event(
membership state: {e}"
)));
},
},
}
},
| _ => (),
}
+3 -2
View File
@@ -19,10 +19,11 @@ pub(crate) async fn well_known_client(
) -> Result<discover_homeserver::Response> {
let client_url = match services.config.well_known.client.as_ref() {
| Some(url) => url.to_string(),
| None =>
| None => {
return Err!(Request(NotFound(
"This server is not configured to serve well-known client information."
))),
)));
},
};
Ok(assign!(discover_homeserver::Response::new(HomeserverInfo::new(client_url)), {