Fix chat notification
This commit is contained in:
parent
f6c894b833
commit
70104529d4
2 changed files with 11 additions and 10 deletions
|
@ -715,9 +715,11 @@ public class LinphoneManager implements LinphoneCoreListener {
|
|||
}
|
||||
|
||||
try {
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(),from);
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(mServiceContext.getContentResolver(), from);
|
||||
if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat__message_notification)) {
|
||||
if(LinphoneActivity.isInstanciated() && LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) {
|
||||
if (LinphoneActivity.isInstanciated() && !LinphoneActivity.instance().displayChatMessageNotification(from.asStringUriOnly())) {
|
||||
return;
|
||||
} else {
|
||||
if (contact != null) {
|
||||
LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getName(), textMessage);
|
||||
} else {
|
||||
|
|
|
@ -268,14 +268,15 @@ public class ApiFivePlus {
|
|||
String sipUri = username + "@" + domain;
|
||||
|
||||
Cursor cursor = getSIPContactCursor(cr, sipUri);
|
||||
Contact contact = getContact(cr, cursor, 0);
|
||||
if (contact != null && contact.getNumbersOrAddresses().contains(sipUri)) {
|
||||
address.setDisplayName(contact.getName());
|
||||
if(cursor != null) {
|
||||
Contact contact = getContact(cr, cursor, 0);
|
||||
if (contact != null && contact.getNumbersOrAddresses().contains(sipUri)) {
|
||||
address.setDisplayName(contact.getName());
|
||||
cursor.close();
|
||||
return contact.getPhotoUri();
|
||||
}
|
||||
cursor.close();
|
||||
return contact.getPhotoUri();
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -286,8 +287,6 @@ public class ApiFivePlus {
|
|||
cursor.close();
|
||||
return contactDisplayName;
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue