mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-28 03:56:20 +00:00
Fixed issue when trying to create a One to One encrypted chat room that already exists
This commit is contained in:
parent
2466373118
commit
ed6cd90397
2 changed files with 16 additions and 7 deletions
|
|
@ -181,14 +181,23 @@ class ChatRoomCreationViewModel : ErrorReportingViewModel() {
|
||||||
Log.w("[Chat Room Creation] Couldn't find existing 1-1 chat room with remote ${address.asStringUriOnly()}, encryption=$encrypted and local identity ${localAddress?.asStringUriOnly()}")
|
Log.w("[Chat Room Creation] Couldn't find existing 1-1 chat room with remote ${address.asStringUriOnly()}, encryption=$encrypted and local identity ${localAddress?.asStringUriOnly()}")
|
||||||
room = coreContext.core.createChatRoom(params, localAddress, participants)
|
room = coreContext.core.createChatRoom(params, localAddress, participants)
|
||||||
|
|
||||||
if (encrypted) {
|
if (room != null) {
|
||||||
room?.addListener(listener)
|
if (encrypted) {
|
||||||
} else {
|
val state = room.state
|
||||||
if (room != null) {
|
if (state == ChatRoom.State.Created) {
|
||||||
chatRoomCreatedEvent.value = Event(room)
|
Log.i("[Chat Room Creation] Found already created chat room, using it")
|
||||||
|
chatRoomCreatedEvent.value = Event(room)
|
||||||
|
waitForChatRoomCreation.value = false
|
||||||
|
} else {
|
||||||
|
Log.i("[Chat Room Creation] Chat room creation is pending [$state], waiting for Created state")
|
||||||
|
room.addListener(listener)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e("[Chat Room Creation] Couldn't create chat room with remote ${address.asStringUriOnly()} and local identity ${localAddress?.asStringUriOnly()}")
|
chatRoomCreatedEvent.value = Event(room)
|
||||||
|
waitForChatRoomCreation.value = false
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("[Chat Room Creation] Couldn't create chat room with remote ${address.asStringUriOnly()} and local identity ${localAddress?.asStringUriOnly()}")
|
||||||
waitForChatRoomCreation.value = false
|
waitForChatRoomCreation.value = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
|
||||||
|
|
||||||
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
private val contactsUpdatedListener = object : ContactsUpdatedListenerStub() {
|
||||||
override fun onContactsUpdated() {
|
override fun onContactsUpdated() {
|
||||||
Log.i("[Chat Room] Contacts have changed")
|
Log.d("[Chat Room] Contacts have changed")
|
||||||
contactLookup()
|
contactLookup()
|
||||||
updateLastMessageToDisplay()
|
updateLastMessageToDisplay()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue