Skip to content
Snippets Groups Projects
Commit 1a48e70a authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

callmodel: do not hold participants when merging calls

Change-Id: I03fab4ac2268f58ef0f0d129524d351003b41a4b
parent 332e2f38
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment