Fixed display issue in contacts' search list in chatfragment

This commit is contained in:
Sylvain Berfini 2016-07-21 12:13:13 +02:00
parent b7c21b57f1
commit fbac8c01cd

View file

@ -1056,7 +1056,13 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
if(ContactsManager.getInstance().hasContacts()) {
for (LinphoneContact con : ContactsManager.getInstance().getContacts()) {
for (LinphoneNumberOrAddress noa : con.getNumbersOrAddresses()) {
list.add(new ContactAddress(con, noa.getValue()));
String value = noa.getValue();
// Fix for sip:username compatibility issue
if (value.startsWith("sip:") && !value.contains("@")) {
value = value.substring(4);
value = LinphoneUtils.getFullAddressFromUsername(value);
}
list.add(new ContactAddress(con, value));
}
}
}
@ -1094,7 +1100,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
}
final String a = contact.address;
final LinphoneContact c = contact.contact;
LinphoneContact c = contact.contact;
TextView name = (TextView) view.findViewById(R.id.contact_name);
name.setText(c.getFullName());