mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Show SIP address extracted from phone number through smart addressbook
This commit is contained in:
parent
8be39a6871
commit
79ca1523ef
2 changed files with 19 additions and 1 deletions
|
|
@ -112,6 +112,24 @@ class ContactViewModel : ViewModel() {
|
|||
addressesAndNumbers.add(data)
|
||||
}
|
||||
for (number in friend.phoneNumbersWithLabel) {
|
||||
val presenceModel = friend.getPresenceModelForUriOrTel(number.phoneNumber)
|
||||
if (presenceModel != null && !presenceModel.contact.isNullOrEmpty()) {
|
||||
// Show linked SIP address
|
||||
val contact = presenceModel.contact
|
||||
if (!contact.isNullOrEmpty()) {
|
||||
val address = core.interpretUrl(contact, true)
|
||||
if (address != null) {
|
||||
val data = ContactNumberOrAddressModel(
|
||||
address,
|
||||
contact,
|
||||
listener,
|
||||
true
|
||||
)
|
||||
addressesAndNumbers.add(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val address = core.interpretUrl(number.phoneNumber, true)
|
||||
val data = ContactNumberOrAddressModel(
|
||||
address,
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class ContactsListViewModel : ViewModel() {
|
|||
applyFilter(
|
||||
filter,
|
||||
"",
|
||||
MagicSearch.Source.Friends.toInt(),
|
||||
MagicSearch.Source.Friends.toInt() or MagicSearch.Source.LdapServers.toInt(),
|
||||
MagicSearch.Aggregation.Friend
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue