1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-07-27 10:18:30 +00:00

style(policy-server): Restructure logging

This commit is contained in:
nexy7574 2025-07-19 20:50:47 +01:00
parent 732c69f5ca
commit 74d60f256b
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F

View file

@ -43,14 +43,21 @@ pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result
let response = match response {
| Ok(response) => response,
| Err(e) => {
warn!("Failed to contact policy server {via} for room {room_id}: {e}");
warn!(
via = %via,
event_id = %pdu.event_id(),
room_id = %room_id,
"Failed to contact policy server: {e}"
);
return Ok(());
},
};
if response.recommendation == "spam" {
warn!(
"Event {} in room {room_id} was marked as spam by policy server {via}",
pdu.event_id().to_owned()
via = %via,
event_id = %pdu.event_id(),
room_id = %room_id,
"Event was marked as spam by policy server",
);
return Err!(Request(Forbidden("Event was marked as spam by policy server")));
}