Always display LDAP contacts in priority. If a local contact matches, partially or totally, the LDAP contact, still display both.

This commit is contained in:
QuentinArguillere 2022-06-27 11:42:24 +02:00
parent 74c69b3779
commit 33b07703ca

View file

@ -58,6 +58,11 @@ import linphonesw
func searchAndAddMatchingContact(searchResult: SearchResult) -> Contact? {
if let friend = searchResult.friend {
if (searchResult.sourceFlags == MagicSearchSource.LdapServers.rawValue), let newContact = Contact(friend: friend.getCobject) {
// Contact comes from LDAP, creating a new one
newContact.createdFromLdap = true
return newContact
}
if let addr = friend.address, let foundContact = getContactFromAddr(addr: addr) {
return foundContact
}
@ -66,11 +71,6 @@ import linphonesw
return foundContact
}
}
// No contacts found (searchResult likely comes from LDAP), creating a new one
if let newContact = Contact(friend: friend.getCobject) {
newContact.createdFromLdap = true
return newContact
}
}
if let addr = searchResult.address, let foundContact = getContactFromAddr(addr: addr) {