mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Send read receipts using the current timeline, not the live timeline (#5731)
This fixes sending read receipts in threaded timelines.
This commit is contained in:
committed by
GitHub
parent
ee49e8fa19
commit
0cb9d86157
+6
-2
@@ -389,13 +389,17 @@ class TimelinePresenter(
|
|||||||
) = launch(dispatchers.computation) {
|
) = launch(dispatchers.computation) {
|
||||||
// If we are at the bottom of timeline, we mark the room as read.
|
// If we are at the bottom of timeline, we mark the room as read.
|
||||||
if (firstVisibleIndex == 0) {
|
if (firstVisibleIndex == 0) {
|
||||||
room.liveTimeline.markAsRead(receiptType = readReceiptType)
|
timelineController.invokeOnCurrentTimeline {
|
||||||
|
markAsRead(receiptType = readReceiptType)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Get last valid EventId seen by the user, as the first index might refer to a Virtual item
|
// Get last valid EventId seen by the user, as the first index might refer to a Virtual item
|
||||||
val eventId = getLastEventIdBeforeOrAt(firstVisibleIndex, timelineItems)
|
val eventId = getLastEventIdBeforeOrAt(firstVisibleIndex, timelineItems)
|
||||||
if (eventId != null && eventId != lastReadReceiptId.value) {
|
if (eventId != null && eventId != lastReadReceiptId.value) {
|
||||||
lastReadReceiptId.value = eventId
|
lastReadReceiptId.value = eventId
|
||||||
room.liveTimeline.sendReadReceipt(eventId = eventId, receiptType = readReceiptType)
|
timelineController.invokeOnCurrentTimeline {
|
||||||
|
sendReadReceipt(eventId = eventId, receiptType = readReceiptType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user