Fix threads sort order, newest first
This commit is contained in:
parent
5ceed4096e
commit
2aa24f0a0d
|
@ -27,5 +27,6 @@ data class ThreadDetails(
|
||||||
val numberOfThreads: Int = 0,
|
val numberOfThreads: Int = 0,
|
||||||
val threadSummarySenderInfo: SenderInfo? = null,
|
val threadSummarySenderInfo: SenderInfo? = null,
|
||||||
val threadSummaryLatestTextMessage: String? = null,
|
val threadSummaryLatestTextMessage: String? = null,
|
||||||
|
val lastMessageTimestamp: Long? = null,
|
||||||
var threadNotificationState: ThreadNotificationState = ThreadNotificationState.NO_NEW_MESSAGE
|
var threadNotificationState: ThreadNotificationState = ThreadNotificationState.NO_NEW_MESSAGE
|
||||||
)
|
)
|
||||||
|
|
|
@ -113,7 +113,9 @@ internal object EventMapper {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
threadNotificationState = eventEntity.threadNotificationState,
|
threadNotificationState = eventEntity.threadNotificationState,
|
||||||
threadSummaryLatestTextMessage = eventEntity.threadSummaryLatestMessage?.root?.asDomain()?.getDecryptedTextSummary().orEmpty()
|
threadSummaryLatestTextMessage = eventEntity.threadSummaryLatestMessage?.root?.asDomain()?.getDecryptedTextSummary().orEmpty(),
|
||||||
|
lastMessageTimestamp = eventEntity.threadSummaryLatestMessage?.root?.originServerTs
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class ThreadListController @Inject constructor(
|
||||||
it.timelineEvent
|
it.timelineEvent
|
||||||
}
|
}
|
||||||
?.forEach { timelineEvent ->
|
?.forEach { timelineEvent ->
|
||||||
val date = dateFormatter.format(timelineEvent.root.originServerTs, DateFormatKind.ROOM_LIST)
|
val date = dateFormatter.format(timelineEvent.root.threadDetails?.lastMessageTimestamp, DateFormatKind.ROOM_LIST)
|
||||||
threadList {
|
threadList {
|
||||||
id(timelineEvent.eventId)
|
id(timelineEvent.eventId)
|
||||||
avatarRenderer(host.avatarRenderer)
|
avatarRenderer(host.avatarRenderer)
|
||||||
|
|
Loading…
Reference in New Issue