Fix : show sender instead of chat room when receiving a message from a chat room and keep the chat room icon in this case

This commit is contained in:
Julien Wadel 2021-09-03 22:30:23 +02:00
parent 1563244581
commit abdc5d0058
2 changed files with 12 additions and 7 deletions

View file

@ -276,10 +276,10 @@ void Notifier::notifyReceivedMessage (const shared_ptr<linphone::ChatMessage> &m
map["message"] = txt;
shared_ptr<linphone::ChatRoom> 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)
}

View file

@ -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 {