Commit 6b157720 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Sort saved local messages according to their timestamps

parent 903ca99c
......@@ -29,7 +29,7 @@ class SharedPreferencesMessagesRepository(
val values = prefs.all.values as Collection<String>
return@withContext values.mapNotNull { adapter.fromJson(it) }.filter {
it.roomId == rid
}.toList()
}.toList().sortedWith(compareBy(Message::timestamp)).reversed()
}
override suspend fun getRecentMessages(rid: String, count: Long): List<Message> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment