diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index fbef41454..33a8b7d12 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -288,9 +288,9 @@ void ChatMessageModel::updateFileTransferInformation(){ mContentListModel->updateContents(this); } -QDateTime ChatMessageModel::initReceivedTimestamp(const std::shared_ptr &message, bool isNew){ +QDateTime ChatMessageModel::initReceivedTimestamp(const std::shared_ptr &message, bool isNew, bool force){ auto appdata = ChatEvent::AppDataManager(QString::fromStdString(message->getAppdata())); - if(!appdata.mData.contains("receivedTime")){// If already set : Do not overwrite. + if(force || !appdata.mData.contains("receivedTime")){// If already set : Do not overwrite. appdata.mData["receivedTime"] = QString::number(isNew ? QDateTime::currentMSecsSinceEpoch() : message->getTime()*1000); qDebug() << (isNew ? "New" : "Old") << " message received at " << QDateTime::fromMSecsSinceEpoch(appdata.mData["receivedTime"].toLongLong()).toString("yyyy/MM/dd hh:mm:ss.zzz") << QDateTime::fromMSecsSinceEpoch(message->getTime()*1000).toString("yyyy/MM/dd hh:mm:ss.zzz"); message->setAppdata(Utils::appStringToCoreString(appdata.toString())); diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.hpp b/linphone-app/src/components/chat-events/ChatMessageModel.hpp index 58f3c8bb1..c2401b43c 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.hpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.hpp @@ -119,7 +119,7 @@ public: virtual void deleteEvent() override; void updateFileTransferInformation(); - static QDateTime initReceivedTimestamp(const std::shared_ptr &message, bool isNew); // return received timestamp + static QDateTime initReceivedTimestamp(const std::shared_ptr &message, bool isNew, bool force = false); // return received timestamp // Linphone callbacks void onFileTransferRecv(const std::shared_ptr & message, const std::shared_ptr & content, const std::shared_ptr & buffer) ; diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index d9cdff814..051a9ec4c 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -1216,7 +1216,7 @@ void ChatRoomModel::onChatMessagesReceived(const std::shared_ptr & chatRoom, const std::shared_ptr & eventLog){ auto message = eventLog->getChatMessage(); if(message){ - ChatMessageModel::initReceivedTimestamp(message, true); + ChatMessageModel::initReceivedTimestamp(message, true, true); insertMessageAtEnd(message); updateLastUpdateTime(); emit messageReceived(message); diff --git a/linphone-app/src/components/participant/ParticipantListModel.cpp b/linphone-app/src/components/participant/ParticipantListModel.cpp index 5dead9369..57472043e 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantListModel.cpp @@ -91,8 +91,11 @@ QString ParticipantListModel::addressesToString()const{ QStringList txt; for(auto item : mList){ auto participant = item.objectCast(); - if( participant->getParticipant())// is Participant. We test it because this participant is not accepted by chat room yet. - txt << Utils::toDisplayString(Utils::coreStringToAppString(participant->getParticipant()->getAddress()->asStringUriOnly()), CoreManager::getInstance()->getSettingsModel()->getSipDisplayMode()); + if( participant->getParticipant()) {// is Participant. We test it because this participant is not accepted by chat room yet. + auto address = participant->getParticipant()->getAddress()->clone(); + address->clean(); + txt << Utils::toDisplayString(Utils::coreStringToAppString(address->asStringUriOnly()), CoreManager::getInstance()->getSettingsModel()->getSipDisplayMode()); + } } txt.removeFirst();// Remove me return txt.join(", "); diff --git a/linphone-app/src/components/recorder/RecordingProxyModel.cpp b/linphone-app/src/components/recorder/RecordingProxyModel.cpp index 1e829df13..b2dcec3f1 100644 --- a/linphone-app/src/components/recorder/RecordingProxyModel.cpp +++ b/linphone-app/src/components/recorder/RecordingProxyModel.cpp @@ -48,8 +48,13 @@ RecordingProxyModel::RecordingProxyModel (QObject *parent) : SortFilterProxyMode void RecordingProxyModel::remove(FileMediaModel * fileModel){ QFile file(fileModel->getFilePath()); - if(file.remove()) - qobject_cast(sourceModel())->remove(fileModel); + auto listModel = qobject_cast(sourceModel()); + auto model = listModel->get(fileModel); + if(model){ + listModel->remove(fileModel); + if(!file.remove()) + listModel->add(model); + } } bool RecordingProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const { diff --git a/linphone-app/ui/views/App/Main/Recordings.qml b/linphone-app/ui/views/App/Main/Recordings.qml index a5060bcde..4774ebe94 100644 --- a/linphone-app/ui/views/App/Main/Recordings.qml +++ b/linphone-app/ui/views/App/Main/Recordings.qml @@ -191,7 +191,11 @@ Item { descriptionText: qsTr('recordingsDelete'), }, function (status) { if (status) { - recordingsProxyModel.remove($modelData) + if(vocalPlayer.item) + vocalPlayer.item.stop() + if(vocalPlayer.active) + vocalPlayer.active = false + recordingsProxyModel.remove($modelData) } })