change(ui): stop relying on a room's stored timeline for marking it as read

This commit is contained in:
Stefan Ceriu
2025-05-19 09:05:51 +03:00
committed by Stefan Ceriu
parent f2ca0697af
commit 70122a4407

View File

@@ -656,11 +656,11 @@ impl Room {
/// Mark a room as read, by attaching a read receipt on the latest event.
///
/// Note: this does NOT unset the unread flag; it's the caller's
/// responsibility to do so, if needs be.
/// responsibility to do so, if need be.
pub async fn mark_as_read(&self, receipt_type: ReceiptType) -> Result<(), ClientError> {
let timeline = self.timeline().await?;
let timeline = TimelineBuilder::new(&self.inner).build().await?;
timeline.mark_as_read(receipt_type).await?;
timeline.mark_as_read(receipt_type.into()).await?;
Ok(())
}