From f73a657a23be2d3d5690069bd7cc32a4897ee881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Fri, 11 Aug 2023 20:29:22 +0200 Subject: [PATCH] fix: ACL error shouldn't break the whole request --- src/api/server_server.rs | 5 ----- src/service/rooms/event_handler/mod.rs | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api/server_server.rs b/src/api/server_server.rs index 9bc9687c..f29de32b 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -735,11 +735,6 @@ pub async fn send_transaction_message_route( }; // We do not add the event_id field to the pdu here because of signature and hashes checks - services() - .rooms - .event_handler - .acl_check(sender_servername, &room_id)?; - let mutex = Arc::clone( services() .globals diff --git a/src/service/rooms/event_handler/mod.rs b/src/service/rooms/event_handler/mod.rs index 899f035a..1fa78b6c 100644 --- a/src/service/rooms/event_handler/mod.rs +++ b/src/service/rooms/event_handler/mod.rs @@ -92,6 +92,8 @@ impl Service { )); } + services().rooms.event_handler.acl_check(origin, &room_id)?; + // 1. Skip the PDU if we already have it as a timeline event if let Some(pdu_id) = services().rooms.timeline.get_pdu_id(event_id)? { return Ok(Some(pdu_id.to_vec()));