Revert receiving time message ordering.

This commit is contained in:
Julien Wadel 2022-06-01 15:42:28 +02:00
parent 893f169b77
commit aa543d66bd
4 changed files with 29 additions and 19 deletions

View file

@ -5,10 +5,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 4.4.2 - [undefined]
## 4.5.0 - [undefined]
### Added
- Based on LinphoneSDK 5.1.34
- Video conference.
### Fixed
- Crash on exit.
- Memory stability.
## 4.4.4 - 2022-06-01
### Fixed
- Revert ordering messages from receiving time.
- Some crashes on Wasapi.
- Update SDK to 5.1.41
## 4.4.3 - 2022-05-30
### Fixed
- Crash on searchs with special characters
- Update SDK to 5.1.38
## 4.4.2 - 2022-05-25
### Added
- Based on LinphoneSDK 5.1.36
- Add Sanitizer build.
- Version types selection for version checker.

View file

@ -107,11 +107,8 @@ ChatMessageModel::ChatMessageModel ( std::shared_ptr<linphone::ChatMessage> chat
txt += content->getUtf8Text().c_str();
}
mContent = txt;
auto appData = AppDataManager(QString::fromStdString(getChatMessage()->getAppdata()));
if(appData.mData.contains("timestamp"))
mTimestamp = QDateTime::fromMSecsSinceEpoch(appData.mData["timestamp"].toLongLong());
else
mTimestamp = QDateTime::fromMSecsSinceEpoch(chatMessage->getTime() * 1000);
mTimestamp = QDateTime::fromMSecsSinceEpoch(chatMessage->getTime() * 1000);
}
mWasDownloaded = false;
@ -236,12 +233,6 @@ void ChatMessageModel::setWasDownloaded(bool wasDownloaded){
void ChatMessageModel::setTimestamp(const QDateTime& timestamp) {
mTimestamp = timestamp;
auto timeT = timestamp.toMSecsSinceEpoch();
auto appData = AppDataManager(QString::fromStdString(getChatMessage()->getAppdata()));
if(appData.mData["timestamp"].toLongLong() != timeT) {
appData.mData["timestamp"] = QString::number(timeT);
getChatMessage()->setAppdata(appData.toString().toStdString());
}
}
//-----------------------------------------------------------------------------------------------------------------------

View file

@ -1173,11 +1173,8 @@ void ChatRoomModel::onNewEvent(const std::shared_ptr<linphone::ChatRoom> & chatR
void ChatRoomModel::onChatMessageReceived(const std::shared_ptr<linphone::ChatRoom> & chatRoom, const std::shared_ptr<const linphone::EventLog> & eventLog) {
auto message = eventLog->getChatMessage();
if(message){
auto messageModel = insertMessageAtEnd(message);
if(messageModel){
messageModel->setTimestamp();
updateLastUpdateTime();
}
insertMessageAtEnd(message);
updateLastUpdateTime();
emit messageReceived(message);
}
}

@ -1 +1 @@
Subproject commit 4c963f6421cefa2f5819146c752c4abd2977854e
Subproject commit d87b868c2ebdeb9a634dfdfd2325412ff9604100