From 243435ae2c2e84bf253c762137bed2de13cb1252 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 4 Jul 2022 17:26:51 +0200 Subject: [PATCH] Update download state on automatic/manual file downloads. --- .../src/components/chat-events/ChatMessageModel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index 0fb334ae5..b242a5e7a 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -299,6 +299,15 @@ void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr &message, linphone::ChatMessage::State state) { updateFileTransferInformation();// On message state, file transfert information Content can be changed + if( state == linphone::ChatMessage::State::FileTransferDone) { + mContentListModel->updateContents(this);// Avoid having leak contents + if( !mWasDownloaded){// Update states + bool allAreDownloaded = true; + for(auto content : mContentListModel->getSharedList()) + allAreDownloaded &= content->mWasDownloaded; + setWasDownloaded(allAreDownloaded); + } + } emit stateChanged(); } void ChatMessageModel::onParticipantImdnStateChanged(const std::shared_ptr & message, const std::shared_ptr & state){