From 1c81553245fc62aaf1e7320efe84018774d1087a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 27 Feb 2024 13:03:34 -0500
Subject: [PATCH] conversationmodel: do not add wrong call to wrong
 conversation

GitLab: #1578
Change-Id: Ibe980844acf1b44afb0ea6aa0e105ffa99e5c36f
---
 src/libclient/conversationmodel.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/libclient/conversationmodel.cpp b/src/libclient/conversationmodel.cpp
index 9f9e35661..525c07d49 100644
--- a/src/libclient/conversationmodel.cpp
+++ b/src/libclient/conversationmodel.cpp
@@ -3218,7 +3218,6 @@ ConversationModelPimpl::slotNewCall(const QString& fromId,
         }
 
         auto& conversation = conversations.at(conversationIndices.at(0));
-        qDebug() << "Add call to conversation " << conversation.uid << " - " << callId;
         conversation.callId = callId;
 
         addOrUpdateCallMessage(callId, fromId, true);
@@ -3315,13 +3314,13 @@ ConversationModelPimpl::addOrUpdateCallMessage(const QString& callId,
         }
         try {
             auto& conv = getConversationForPeerUri(from).get();
-            if (conv.callId.isEmpty())
+            if (!conv.isSwarm() && conv.callId.isEmpty()) {
                 conv.callId = callId;
+            }
         } catch (...) {
             return;
         }
     }
-    // do not save call interaction for swarm conversation
     if (conv_it->isSwarm())
         return;
     auto uriString = incoming ? storage::prepareUri(from, linked.owner.profileInfo.type)
-- 
GitLab