Commit 392faa90 authored by Shailesh Baldaniya's avatar Shailesh Baldaniya

fix: Grouping for Live Chat

parent d0ce271b
......@@ -205,10 +205,6 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
}
}
private fun compareBy(selector: KProperty<Message?>): Comparator<ChatRoom> {
return Comparator { a, b -> (a.lastMessage?.timestamp!! - b.lastMessage?.timestamp!!).toInt() }
}
private fun compareBy(selector: KProperty1<ChatRoom, RoomType>): Comparator<ChatRoom> {
return Comparator { a, b -> getTypeConstant(a.type) - getTypeConstant(b.type) }
}
......@@ -218,6 +214,7 @@ class ChatRoomsPresenter @Inject constructor(private val view: ChatRoomsView,
is RoomType.Channel -> Constants.CHATROOM_CHANNEL
is RoomType.PrivateGroup -> Constants.CHATROOM_PRIVATE_GROUP
is RoomType.DirectMessage -> Constants.CHATROOM_DM
is RoomType.Livechat -> Constants.CHATROOM_LIVE_CHAT
else -> 0
}
}
......
......@@ -9,6 +9,7 @@ object Constants {
const val CHATROOM_CHANNEL = 0
const val CHATROOM_PRIVATE_GROUP = 1
const val CHATROOM_DM = 2
const val CHATROOM_LIVE_CHAT = 3
}
object ChatRoomsSortOrder {
......
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