From 54c94ca9ad899fd05fd19534814542abf812c84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Dele=C5=84kec?= Date: Wed, 1 Jul 2026 09:45:34 +0100 Subject: [PATCH] fix(appservice): Re-add room membership conditions for event sending They accidentally got removed in a recent refactor Fixes #1890 --- src/service/rooms/timeline/append.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/service/rooms/timeline/append.rs b/src/service/rooms/timeline/append.rs index 76e19f10f..568526619 100644 --- a/src/service/rooms/timeline/append.rs +++ b/src/service/rooms/timeline/append.rs @@ -458,6 +458,16 @@ impl super::Service { pdu: &PduEvent, ) -> bool { let room_id = pdu.room_id().unwrap(); + + if self + .services + .state_cache + .appservice_in_room(room_id, appservice) + .await + { + return true; + } + let target = if *pdu.kind() == TimelineEventType::RoomMember { pdu.state_key().and_then(|sk| UserId::parse(sk).ok()) } else { @@ -472,8 +482,13 @@ impl super::Service { | _ => (false, false), }; let sender_matches_namespace = appservice.users.is_match(pdu.sender().as_str()); + let room_matches_namespace = appservice.rooms.is_match(room_id.as_str()); - if target_matches_sender || target_matches_namespace || sender_matches_namespace { + if target_matches_sender + || target_matches_namespace + || sender_matches_namespace + || room_matches_namespace + { return true; }