From e3c9f6128a4f2b6dba05829863c845f12e155363 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Mon, 12 Jul 2021 11:21:46 -0400
Subject: [PATCH] conversationmodel: update path only for swarm

as awaiting host will not return any path for legacy, causing
the interaction to not update

GitLab: https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/455
Change-Id: Icbf49dcab5a4dff030f380dcecd40c1919f89146
---
 src/conversationmodel.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp
index 1418ade6..18d6ba4b 100644
--- a/src/conversationmodel.cpp
+++ b/src/conversationmodel.cpp
@@ -3888,7 +3888,8 @@ ConversationModelPimpl::updateTransferStatus(const QString& fileId,
     if (conversationIdx < 0) {
         return false;
     }
-    if (conversations[conversationIdx].mode == conversation::Mode::NON_SWARM) {
+    auto& conversation = conversations[conversationIdx];
+    if (conversation.isLegacy()) {
         storage::updateInteractionStatus(db, interactionId, newStatus);
     }
     bool emitUpdated = false;
@@ -3900,7 +3901,9 @@ ConversationModelPimpl::updateTransferStatus(const QString& fileId,
         if (it != interactions.end()) {
             emitUpdated = true;
             it->second.status = newStatus;
-            it->second.body = info.path;
+            if (conversation.isSwarm()) {
+                it->second.body = info.path;
+            }
             itCopy = it->second;
         }
     }
-- 
GitLab