diff --git a/src/manager.cpp b/src/manager.cpp index fac2a86441ed80a37d634abe04d1309042a2a616..01862b792ad315a901caa62ddb2a0fad71dbdb38 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);