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:
parent
732c69f5ca
commit
74d60f256b
1 changed files with 10 additions and 3 deletions
|
@ -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")));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue