From c5f7584d0a0435b32f2431d740e77b3109490f70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Fri, 25 Sep 2020 16:40:33 -0400
Subject: [PATCH] calladapter: setActiveParticipant accepts URI

Change-Id: I7de33f90ff291979808b568183e57ab551210942
---
 src/calladapter.cpp | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/calladapter.cpp b/src/calladapter.cpp
index e330cd5c8..d556a9e59 100644
--- a/src/calladapter.cpp
+++ b/src/calladapter.cpp
@@ -548,28 +548,21 @@ CallAdapter::maximizeParticipant(const QString& uri, bool isActive)
     const auto conversation = convModel->getConversationForUID(LRCInstance::getCurrentConvUid());
     const auto confId = conversation.confId;
 
-    QString callId;
-    if (LRCInstance::getCurrentAccountInfo().profileInfo.uri != uri) {
-        const auto convInfo = LRCInstance::getConversationFromPeerUri(uri, accountId_);
-        if (!convInfo.uid.isEmpty()) {
-            callId = convInfo.callId;
-        }
-    }
     try {
         const auto call = callModel->getCall(confId);
         switch (call.layout) {
         case lrc::api::call::Layout::GRID:
-            callModel->setActiveParticipant(confId, callId);
+            callModel->setActiveParticipant(confId, uri);
             callModel->setConferenceLayout(confId, lrc::api::call::Layout::ONE_WITH_SMALL);
             break;
         case lrc::api::call::Layout::ONE_WITH_SMALL:
-            callModel->setActiveParticipant(confId, callId);
+            callModel->setActiveParticipant(confId, uri);
             callModel->setConferenceLayout(confId,
                                            isActive ? lrc::api::call::Layout::ONE
                                                     : lrc::api::call::Layout::ONE_WITH_SMALL);
             break;
         case lrc::api::call::Layout::ONE:
-            callModel->setActiveParticipant(confId, callId);
+            callModel->setActiveParticipant(confId, uri);
             callModel->setConferenceLayout(confId, lrc::api::call::Layout::GRID);
             break;
         };
-- 
GitLab