mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent case causing memory chat room to be re-used as a diffent one, leading to duplicated listener
This commit is contained in:
parent
ce1c3dad65
commit
5c77b58154
1 changed files with 12 additions and 4 deletions
|
|
@ -105,11 +105,19 @@ abstract class AbstractConversationViewModel : GenericViewModel() {
|
|||
)
|
||||
)
|
||||
if (found != null) {
|
||||
chatRoom = found
|
||||
if (::chatRoom.isInitialized && chatRoom == found) {
|
||||
Log.i("$TAG Conversation object already in memory, keeping it")
|
||||
beforeNotifyingChatRoomFound(sameOne = true)
|
||||
chatRoomFoundEvent.postValue(Event(true))
|
||||
afterNotifyingChatRoomFound(sameOne = true)
|
||||
} else {
|
||||
chatRoom = found
|
||||
Log.i("$TAG Found conversation in Core, using it")
|
||||
|
||||
beforeNotifyingChatRoomFound(sameOne = false)
|
||||
chatRoomFoundEvent.postValue(Event(true))
|
||||
afterNotifyingChatRoomFound(sameOne = false)
|
||||
beforeNotifyingChatRoomFound(sameOne = false)
|
||||
chatRoomFoundEvent.postValue(Event(true))
|
||||
afterNotifyingChatRoomFound(sameOne = false)
|
||||
}
|
||||
} else {
|
||||
Log.e("$TAG Failed to find conversation given local & remote addresses!")
|
||||
chatRoomFoundEvent.postValue(Event(false))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue