diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp index e01ce541ae6042b627975ff395c3ee3f3598257e..8a86e8305ac144c41d31aa9679273d1e706fbaaf 100644 --- a/src/newcallmodel.cpp +++ b/src/newcallmodel.cpp @@ -425,6 +425,7 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const // Unpause conference if conference was not active CallManager::instance().unholdConference(conf); auto accountCall = call1.type == call::Type::CONFERENCE ? accountIdCall2 : accountIdCall1; + bool joined = CallManager::instance().addParticipant(call, conf); if (!joined) { qWarning() << "Call: " << call << " couldn't join conference " << conf; @@ -440,8 +441,10 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const } catch (...) {} } else emit callAddedToConference(call, conf); - } - else { + + // Remove from pendingConferences_ + pimpl_->pendingConferences_.erase(call); + } else { CallManager::instance().joinParticipant(callIdA, callIdB); // NOTE: This will trigger slotConferenceCreated. } @@ -617,8 +620,11 @@ NewCallModel::setCurrentCall(const QString& callId) const return; } for (const auto& confId : conferences) { - if (callId != confId) - CallManager::instance().holdConference(confId); + if (callId != confId) { + QStringList callList = CallManager::instance().getParticipantList(callId); + if (callList.indexOf(callId) == -1) + CallManager::instance().holdConference(confId); + } } } @@ -728,7 +734,6 @@ NewCallModelPimpl::slotCallStateChanged(const QString& callId, const QString& st auto it = pendingConferences_.find(callId); if (it != pendingConferences_.end()) { linked.joinCalls(it->second, it->first); - pendingConferences_.erase(it); } } } @@ -800,7 +805,10 @@ NewCallModelPimpl::slotConferenceCreated(const QString& confId) QStringList callList = CallManager::instance().getParticipantList(confId); foreach(const auto& call, callList) { emit linked.callAddedToConference(call, confId); + // Remove acll from pendingConferences_ + pendingConferences_.erase(call); } + } void