From 466152afd35632cfb1986a01a75f016a2851d2bf 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 bdbb5160b..f5cfc878e 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -334,6 +334,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->getContents()) + allAreDownloaded &= content->mWasDownloaded; + setWasDownloaded(allAreDownloaded); + } + } emit stateChanged(); } void ChatMessageModel::onParticipantImdnStateChanged(const std::shared_ptr & message, const std::shared_ptr & state){