From 6c7b4d4256d7fa4b71c1efec3bcbfbce3d64dd43 Mon Sep 17 00:00:00 2001 From: Claire G Date: Mon, 14 Mar 2022 17:10:58 +0100 Subject: [PATCH] Fix PR comment --- .../timeline/factory/ReadReceiptsItemFactory.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/ReadReceiptsItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/ReadReceiptsItemFactory.kt index 502f17e78b..ed3cc8df53 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/ReadReceiptsItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/ReadReceiptsItemFactory.kt @@ -37,22 +37,16 @@ class ReadReceiptsItemFactory @Inject constructor(private val avatarRenderer: Av val readReceiptsData = readReceipts .map { ReadReceiptData(it.roomMember.userId, it.roomMember.avatarUrl, it.roomMember.displayName, it.originServerTs) - }.toList() - val readReceiptsDataSorted = sortItem(readReceiptsData) + } + .sortedByDescending { it.timestamp } return ReadReceiptsItem_() .id("read_receipts_$eventId") .eventId(eventId) - .readReceipts(readReceiptsDataSorted) + .readReceipts(readReceiptsData) .avatarRenderer(avatarRenderer) .shouldHideReadReceipts(isFromThreadTimeLine) .clickListener { - callback?.onReadReceiptsClicked(readReceiptsDataSorted) + callback?.onReadReceiptsClicked(readReceiptsData) } } - - fun sortItem(readReceipt: List): List { - return readReceipt.sortedByDescending { - it.timestamp - } - } }