Fixed contacts list issue when creating a chat room or a conference
This commit is contained in:
parent
a1f9b95432
commit
d1d4ce558a
1 changed files with 14 additions and 7 deletions
|
@ -59,13 +59,20 @@ class ContactSelectionData(private val searchResult: SearchResult) : ContactData
|
|||
}
|
||||
|
||||
private fun searchMatchingContact() {
|
||||
val address = searchResult.address
|
||||
if (address != null) {
|
||||
contact.value = coreContext.contactsManager.findContactByAddress(address)
|
||||
displayName.value = searchResult.friend?.name ?: LinphoneUtils.getDisplayName(address)
|
||||
} else if (searchResult.phoneNumber != null) {
|
||||
contact.value = coreContext.contactsManager.findContactByPhoneNumber(searchResult.phoneNumber.orEmpty())
|
||||
displayName.value = searchResult.friend?.name ?: searchResult.phoneNumber.orEmpty()
|
||||
val friend = searchResult.friend
|
||||
if (friend != null) {
|
||||
contact.value = friend
|
||||
displayName.value = friend.name
|
||||
} else {
|
||||
val address = searchResult.address
|
||||
if (address != null) {
|
||||
contact.value = coreContext.contactsManager.findContactByAddress(address)
|
||||
displayName.value = LinphoneUtils.getDisplayName(address)
|
||||
} else if (searchResult.phoneNumber != null) {
|
||||
contact.value =
|
||||
coreContext.contactsManager.findContactByPhoneNumber(searchResult.phoneNumber.orEmpty())
|
||||
displayName.value = searchResult.phoneNumber.orEmpty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue