From a98b6dfcb1d997923387d723d7a83daf3d98093f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Mon, 13 Jul 2020 16:51:06 -0400
Subject: [PATCH] manager: detach conference instead of holding

Change-Id: I2bf4ba82b72963109f1ffc7f959fc928abb0bbe7
---
 src/manager.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/manager.cpp b/src/manager.cpp
index 9b5f19a88d..760d6ba041 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -1268,10 +1268,7 @@ bool
 Manager::holdConference(const std::string& id)
 {
     if (auto conf = getConferenceFromID(id)) {
-        for (const auto &item : conf->getParticipantList())
-            onHoldCall(item);
-
-        conf->setState(Conference::State::HOLD);
+        conf->detach();
         emitSignal<DRing::CallSignal::ConferenceChanged>(conf->getConfID(), conf->getStateStr());
         return true;
     }
@@ -1292,6 +1289,8 @@ Manager::unHoldConference(const std::string& id)
             conf->setState(Conference::State::ACTIVE_ATTACHED);
             emitSignal<DRing::CallSignal::ConferenceChanged>(conf->getConfID(), conf->getStateStr());
             return true;
+        } else if (conf->getState() == Conference::State::ACTIVE_DETACHED) {
+            pimpl_->addMainParticipant(*conf);
         }
     }
     return false;
-- 
GitLab