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

fix(policy-server): Avoid unnecessary database lookup

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

View file

@ -26,20 +26,11 @@ pub async fn policyserv_check(&self, pdu: &PduEvent, room_id: &RoomId) -> Result
return Ok(());
},
};
// TODO: dont do *this*
let pdu_json = self.services.timeline.get_pdu_json(pdu.event_id()).await?;
let outgoing = self
.services
.sending
.convert_to_outgoing_federation_event(pdu_json)
.convert_to_outgoing_federation_event(pdu.to_canonical_object())
.await;
// let s = match serde_json::to_string(outgoing.as_ref()) {
// | Ok(s) => s,
// | Err(e) => {
// warn!("Failed to convert pdu {} to outgoing federation event: {e}",
// pdu.event_id()); return Err!(Request(InvalidParam("Failed to convert PDU
// to outgoing event."))); },
// };
debug!("Checking pdu {outgoing:?} for spam with policy server {via} for room {room_id}");
let response = self
.services