From 8a5cf998beb5143710721c52c90d7aedf418d71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Fri, 14 Nov 2025 11:55:49 +0100 Subject: [PATCH] Send read receipts using the current timeline, not the live timeline This fixes sending read receipts in threaded timelines. --- .../features/messages/impl/timeline/TimelinePresenter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt index 6c7d6c24a27..596c1d87e47 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelinePresenter.kt @@ -389,13 +389,17 @@ class TimelinePresenter( ) = launch(dispatchers.computation) { // If we are at the bottom of timeline, we mark the room as read. if (firstVisibleIndex == 0) { - room.liveTimeline.markAsRead(receiptType = readReceiptType) + timelineController.invokeOnCurrentTimeline { + markAsRead(receiptType = readReceiptType) + } } else { // Get last valid EventId seen by the user, as the first index might refer to a Virtual item val eventId = getLastEventIdBeforeOrAt(firstVisibleIndex, timelineItems) if (eventId != null && eventId != lastReadReceiptId.value) { lastReadReceiptId.value = eventId - room.liveTimeline.sendReadReceipt(eventId = eventId, receiptType = readReceiptType) + timelineController.invokeOnCurrentTimeline { + sendReadReceipt(eventId = eventId, receiptType = readReceiptType) + } } } }