mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed missing chat room if you created one and sent a message in it
This commit is contained in:
parent
9381b459a0
commit
709f7dd3c5
1 changed files with 11 additions and 1 deletions
|
|
@ -66,7 +66,17 @@ class ConversationsListViewModel
|
|||
|
||||
@WorkerThread
|
||||
override fun onMessageSent(core: Core, chatRoom: ChatRoom, message: ChatMessage) {
|
||||
reorderChatRooms()
|
||||
val id = LinphoneUtils.getChatRoomId(chatRoom)
|
||||
val found = conversations.value.orEmpty().find {
|
||||
it.id == id
|
||||
}
|
||||
if (found == null) {
|
||||
Log.i("$TAG Message sent for a conversation not yet in the list (probably was empty), adding it")
|
||||
addChatRoom(chatRoom)
|
||||
} else {
|
||||
Log.i("$TAG Message sent for an existing conversation, re-order them")
|
||||
reorderChatRooms()
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue