From abdc5d0058c94e9408e5f9d9216ef3b51238d8fd Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 3 Sep 2021 22:30:23 +0200 Subject: [PATCH] Fix : show sender instead of chat room when receiving a message from a chat room and keep the chat room icon in this case --- linphone-app/src/components/notifier/Notifier.cpp | 8 ++++---- .../Notifications/NotificationReceivedMessage.qml | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/linphone-app/src/components/notifier/Notifier.cpp b/linphone-app/src/components/notifier/Notifier.cpp index 61a291e14..0a726c80b 100644 --- a/linphone-app/src/components/notifier/Notifier.cpp +++ b/linphone-app/src/components/notifier/Notifier.cpp @@ -276,10 +276,10 @@ void Notifier::notifyReceivedMessage (const shared_ptr &m map["message"] = txt; shared_ptr chatRoom(message->getChatRoom()); map["timelineModel"].setValue(CoreManager::getInstance()->getTimelineListModel()->getTimeline(chatRoom, true).get()); - map["peerAddress"] = Utils::coreStringToAppString(chatRoom->getPeerAddress()->asStringUriOnly()); - map["localAddress"] = Utils::coreStringToAppString(chatRoom->getLocalAddress()->asStringUriOnly()); - map["fullPeerAddress"] = Utils::coreStringToAppString(chatRoom->getPeerAddress()->asString()); - map["fullLocalAddress"] = Utils::coreStringToAppString(chatRoom->getLocalAddress()->asString()); + map["peerAddress"] = Utils::coreStringToAppString(message->getFromAddress()->asStringUriOnly()); + map["localAddress"] = Utils::coreStringToAppString(message->getToAddress()->asStringUriOnly()); + map["fullPeerAddress"] = Utils::coreStringToAppString(message->getFromAddress()->asString()); + map["fullLocalAddress"] = Utils::coreStringToAppString(message->getToAddress()->asString()); map["window"].setValue(App::getInstance()->getMainWindow()); CREATE_NOTIFICATION(Notifier::ReceivedMessage, map) } diff --git a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml index 74a8e4e10..d349dc0c8 100644 --- a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml +++ b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml @@ -37,9 +37,14 @@ Notification { Contact { Layout.fillWidth: true - - //entry: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress) - entry:notification.timelineModel.getChatRoomModel() + property ChatRoomModel chatRoomModel : notification.timelineModel.getChatRoomModel() + //entry: notification.fullPeerAddress? SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress): notification.timelineModel.getChatRoomModel() + entry: ({ + sipAddress: SipAddressesModel.getSipAddressObserver(notification.fullPeerAddress, notification.fullLocalAddress), + isOneToOne: chatRoomModel.isOneToOne, + haveEncryption: chatRoomModel.haveEncryption, + securityLevel: chatRoomModel.securityLevel + }) } Rectangle {