From fe06d78c8e410df4db6b155c5c08bc60114fa404 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Wed, 23 Jul 2025 17:58:33 +0100 Subject: [PATCH] fix(policy-server): Update ask_policy_server docstring --- src/service/rooms/event_handler/policy_server.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/service/rooms/event_handler/policy_server.rs b/src/service/rooms/event_handler/policy_server.rs index debd9a28..2068dff7 100644 --- a/src/service/rooms/event_handler/policy_server.rs +++ b/src/service/rooms/event_handler/policy_server.rs @@ -12,7 +12,16 @@ use ruma::{ events::{StateEventType, room::policy::RoomPolicyEventContent}, }; -/// Returns Ok if the policy server allows the event +/// Asks a remote policy server if the event is allowed. +/// +/// If the event is the `org.matrix.msc4284.policy` configuration state event, +/// this check is skipped. Similarly, if there is no policy server configured in +/// the PDU's room, or the configured server is not present in the room, the +/// check is also skipped. +/// +/// If the policy server marks the event as spam, Ok(false) is returned, +/// otherwise Ok(true) allows the event. If the policy server cannot be +/// contacted for whatever reason, Err(e) is returned. #[implement(super::Service)] #[tracing::instrument(skip_all, level = "debug")] pub async fn ask_policy_server(&self, pdu: &PduEvent, room_id: &RoomId) -> Result {