ignore read receipts from ACL'd servers and users not joined

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-26 15:02:33 -04:00 committed by June 🍓🦴
parent 003d4edbfa
commit b8ec763a7c

View file

@ -327,6 +327,17 @@ pub(crate) async fn send_transaction_message_route(
for (room_id, room_updates) in receipt.receipts {
for (user_id, user_updates) in room_updates.read {
if services()
.rooms
.event_handler
.acl_check(user_id.server_name(), &room_id)
.is_err()
{
debug_warn!(%user_id, %room_id, "received read receipt EDU from ACL'd user's server");
continue;
}
if services().rooms.state_cache.is_joined(&user_id, &room_id)? {
if let Some((event_id, _)) = user_updates
.event_ids
.iter()
@ -362,6 +373,10 @@ pub(crate) async fn send_transaction_message_route(
// TODO fetch missing events
debug_error!("No known event ids in read receipt: {:?}", user_updates);
}
} else {
debug_warn!(%user_id, %room_id, "received read receipt EDU for user not in room");
continue;
}
}
}
},