Fixed phone number contacts search

This commit is contained in:
Sylvain Berfini 2017-12-06 13:05:41 +01:00
parent 171b17892b
commit 3491ff723f

View file

@ -225,7 +225,7 @@ public class ContactsManager extends ContentObserver {
LinphoneContact contact = (LinphoneContact)lf.getUserData(); LinphoneContact contact = (LinphoneContact)lf.getUserData();
return contact; return contact;
} }
return null; return findContactFromPhoneNumber(address.getUsername());
} }
public synchronized LinphoneContact findContactFromPhoneNumber(String phoneNumber) { public synchronized LinphoneContact findContactFromPhoneNumber(String phoneNumber) {
@ -242,7 +242,7 @@ public class ContactsManager extends ContentObserver {
if (addr == null) { if (addr == null) {
return null; return null;
} }
addr.setMethodParam(";user=phone"); addr.setUriParam("user", "phone");
Friend lf = lc.findFriend(addr); // Without this, the hashmap inside liblinphone won't find it... Friend lf = lc.findFriend(addr); // Without this, the hashmap inside liblinphone won't find it...
if (lf != null) { if (lf != null) {
LinphoneContact contact = (LinphoneContact)lf.getUserData(); LinphoneContact contact = (LinphoneContact)lf.getUserData();