From 50338b4548ae19c79f1303154baf8c0f8cc96136 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 6 Nov 2017 09:33:10 +0100 Subject: [PATCH] Fixed chat message notification coming from a 1 to 1 group chat room --- src/android/org/linphone/LinphoneManager.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/android/org/linphone/LinphoneManager.java b/src/android/org/linphone/LinphoneManager.java index e903a3921..eb2dcce44 100644 --- a/src/android/org/linphone/LinphoneManager.java +++ b/src/android/org/linphone/LinphoneManager.java @@ -1233,19 +1233,19 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso String textMessage = (message.getFileTransferInformation() != null) ? getString(R.string.content_description_incoming_file) : message.getText(); if (!mServiceContext.getResources().getBoolean(R.bool.disable_chat_message_notification)) { - if (cr.canHandleParticipants()) { + if (!cr.canHandleParticipants() || (cr.getNbParticipants() == 1 && getString(R.string.dummy_group_chat_subject).equals(cr.getSubject()))) { + if (contact != null) { + LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getFullName(), contact.getThumbnailUri(), textMessage); + } else { + LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), from.getUsername(), null, textMessage); + } + } else { String subject = cr.getSubject(); if (contact != null) { LinphoneService.instance().displayGroupChatMessageNotification(subject, cr.getConferenceAddress().asString(), contact.getFullName(), contact.getThumbnailUri(), textMessage); } else { LinphoneService.instance().displayGroupChatMessageNotification(subject, cr.getConferenceAddress().asString(), from.getUsername(), null, textMessage); } - } else { - if (contact != null) { - LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), contact.getFullName(), contact.getThumbnailUri(), textMessage); - } else { - LinphoneService.instance().displayMessageNotification(from.asStringUriOnly(), from.getUsername(), null, textMessage); - } } } }