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