From 57e675b7acdac9a552a6a511619e34db18b2a403 Mon Sep 17 00:00:00 2001 From: Pierre Lespagnol <pierre.lespagnol@savoirfairelinux.com> Date: Wed, 25 Sep 2019 14:55:53 -0400 Subject: [PATCH] conference: fix join between 2 conferences Participants were detached from conf1 and attached to conf2 one by one, the last participant was detached but not removed from conference object because manager didn't consider the call as conference anymore because there was only 1 participant left. Instead we detach and remove all participants from conf1 before add them to conf2. Change-Id: Iac8c4d52d775397b94029fbdf90abf86103bfca5 Gitlab: #164 --- src/manager.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/manager.cpp b/src/manager.cpp index fac2a86441..01862b792a 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -1662,6 +1662,28 @@ Manager::joinConference(const std::string& conf_id1, auto conf = pimpl_->conferenceMap_.find(conf_id1)->second; ParticipantSet participants(conf->getParticipantList()); + // Detach and remove all participant from conf1 before add + // ... to conf2 + for (const auto &p : participants) { + JAMI_DBG("Detach participant %s", p.c_str()); + auto call = getCallFromCallID(p); + if (!call) { + JAMI_ERR("Could not find call %s", p.c_str()); + continue; + } + + if (!getConferenceFromCallID(p)) { + JAMI_ERR("Call is not conferencing, cannot detach"); + continue; + } + + conf->remove(p); + call->setConfId(""); + removeAudio(*call); + } + // Remove conf1 + pimpl_->base_.removeConference(conf_id1); + for (const auto &p : participants) addParticipant(p, conf_id2); -- GitLab