Commit f4bd7b85 authored by Ronan's avatar Ronan

fix(SipAddressesModel): handle correctly chat message changes (do not use...

fix(SipAddressesModel): handle correctly chat message changes (do not use from/to, use local/peer of ChatRoom)
parent 3ea2478c
......@@ -287,8 +287,8 @@ void SipAddressesModel::handleSipAddressRemoved (ContactModel *contact, const QS
}
void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMessage> &message) {
const QString sipAddress = Utils::coreStringToAppString(message->getFromAddress()->asStringUriOnly());
addOrUpdateSipAddress(sipAddress, message);
const QString peerAddress(Utils::coreStringToAppString(message->getChatRoom()->getPeerAddress()->asStringUriOnly()));
addOrUpdateSipAddress(peerAddress, message);
}
void SipAddressesModel::handleCallStateChanged (
......@@ -454,9 +454,10 @@ void SipAddressesModel::addOrUpdateSipAddress (SipAddressEntry &sipAddressEntry,
}
void SipAddressesModel::addOrUpdateSipAddress (SipAddressEntry &sipAddressEntry, const shared_ptr<linphone::ChatMessage> &message) {
int count = message->getChatRoom()->getUnreadMessagesCount();
shared_ptr<linphone::ChatRoom> chatRoom(message->getChatRoom());
int count = chatRoom->getUnreadMessagesCount();
QString localAddress(Utils::coreStringToAppString(message->getLocalAddress()->asStringUriOnly()));
QString localAddress(Utils::coreStringToAppString(chatRoom->getLocalAddress()->asStringUriOnly()));
ConferenceEntry &conferenceEntry = sipAddressEntry.localAddressToConferenceEntry[localAddress];
conferenceEntry.timestamp = QDateTime::fromMSecsSinceEpoch(message->getTime() * 1000);
conferenceEntry.unreadMessageCount = count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment