mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-22 22:28:08 +00:00
fix(SipAddressesModel): handle correctly chat message changes (do not use from/to, use local/peer of ChatRoom)
This commit is contained in:
parent
3ea2478c23
commit
f4bd7b8510
1 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue