Fix most incorrect unreads on startup (#433)
This commit is contained in:
@@ -302,7 +302,7 @@ async fn load_older_one(
|
|||||||
|
|
||||||
let event_id = msg.event_id();
|
let event_id = msg.event_id();
|
||||||
let receipts = match room
|
let receipts = match room
|
||||||
.load_event_receipts(ReceiptType::Read, ReceiptThread::Main, event_id)
|
.load_event_receipts(ReceiptType::Read, ReceiptThread::Unthreaded, event_id)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(receipts) => receipts.into_iter().map(|(u, _)| u).collect(),
|
Ok(receipts) => receipts.into_iter().map(|(u, _)| u).collect(),
|
||||||
@@ -1044,7 +1044,10 @@ impl ClientWorker {
|
|||||||
let Some(receipts) = receipts.get(&ReceiptType::Read) else {
|
let Some(receipts) = receipts.get(&ReceiptType::Read) else {
|
||||||
continue;
|
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());
|
info.set_receipt(user_id.to_owned(), event_id.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user