Skip to content
Snippets Groups Projects
Commit 5a19df04 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

conversation: use correct last interaction

Change-Id: I2ef3d3aa278e706af334ad873a5bd7b9cfcc1d67
parent f61de0ad
No related branches found
No related tags found
No related merge requests found
......@@ -410,12 +410,9 @@ class Conversation : ConversationHistory {
@Synchronized
fun sortHistory() {
if (mDirty) {
//Log.w(TAG, "sortHistory()")
aggregateHistory.sortWith { c1, c2 -> c1.timestamp.compareTo(c2.timestamp) }
for (i in aggregateHistory.asReversed())
if (i.type != Interaction.InteractionType.INVALID) {
lastEventSubject.onNext(aggregateHistory.last())
break
aggregateHistory.lastOrNull { it.type != Interaction.InteractionType.INVALID }?.let {
lastEventSubject.onNext(it)
}
mDirty = false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment