From f39261ff84678feae1e58a5e050fbe4bd4ae27b5 Mon Sep 17 00:00:00 2001 From: VAWVAW <94846592+VAWVAW@users.noreply.github.com> Date: Fri, 30 May 2025 15:56:46 +0000 Subject: [PATCH] Fix most incorrect unreads on startup (#433) --- src/worker.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/worker.rs b/src/worker.rs index 053a5b5..1ef633c 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -302,7 +302,7 @@ async fn load_older_one( let event_id = msg.event_id(); let receipts = match room - .load_event_receipts(ReceiptType::Read, ReceiptThread::Main, event_id) + .load_event_receipts(ReceiptType::Read, ReceiptThread::Unthreaded, event_id) .await { Ok(receipts) => receipts.into_iter().map(|(u, _)| u).collect(), @@ -1044,7 +1044,10 @@ impl ClientWorker { let Some(receipts) = receipts.get(&ReceiptType::Read) else { continue; }; - for user_id in receipts.keys() { + for (user_id, _) in receipts + .iter() + .filter(|(_, rcpt)| rcpt.thread == ReceiptThread::Unthreaded) + { info.set_receipt(user_id.to_owned(), event_id.clone()); } }