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
Branches
Tags
No related merge requests found
...@@ -425,6 +425,7 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const ...@@ -425,6 +425,7 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const
// Unpause conference if conference was not active // Unpause conference if conference was not active
CallManager::instance().unholdConference(conf); CallManager::instance().unholdConference(conf);
auto accountCall = call1.type == call::Type::CONFERENCE ? accountIdCall2 : accountIdCall1; auto accountCall = call1.type == call::Type::CONFERENCE ? accountIdCall2 : accountIdCall1;
bool joined = CallManager::instance().addParticipant(call, conf); bool joined = CallManager::instance().addParticipant(call, conf);
if (!joined) { if (!joined) {
qWarning() << "Call: " << call << " couldn't join conference " << conf; qWarning() << "Call: " << call << " couldn't join conference " << conf;
...@@ -440,8 +441,10 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const ...@@ -440,8 +441,10 @@ NewCallModel::joinCalls(const QString& callIdA, const QString& callIdB) const
} catch (...) {} } catch (...) {}
} else } else
emit callAddedToConference(call, conf); emit callAddedToConference(call, conf);
}
else { // Remove from pendingConferences_
pimpl_->pendingConferences_.erase(call);
} else {
CallManager::instance().joinParticipant(callIdA, callIdB); CallManager::instance().joinParticipant(callIdA, callIdB);
// NOTE: This will trigger slotConferenceCreated. // NOTE: This will trigger slotConferenceCreated.
} }
...@@ -617,8 +620,11 @@ NewCallModel::setCurrentCall(const QString& callId) const ...@@ -617,8 +620,11 @@ NewCallModel::setCurrentCall(const QString& callId) const
return; return;
} }
for (const auto& confId : conferences) { for (const auto& confId : conferences) {
if (callId != confId) if (callId != confId) {
CallManager::instance().holdConference(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 ...@@ -728,7 +734,6 @@ NewCallModelPimpl::slotCallStateChanged(const QString& callId, const QString& st
auto it = pendingConferences_.find(callId); auto it = pendingConferences_.find(callId);
if (it != pendingConferences_.end()) { if (it != pendingConferences_.end()) {
linked.joinCalls(it->second, it->first); linked.joinCalls(it->second, it->first);
pendingConferences_.erase(it);
} }
} }
} }
...@@ -800,7 +805,10 @@ NewCallModelPimpl::slotConferenceCreated(const QString& confId) ...@@ -800,7 +805,10 @@ NewCallModelPimpl::slotConferenceCreated(const QString& confId)
QStringList callList = CallManager::instance().getParticipantList(confId); QStringList callList = CallManager::instance().getParticipantList(confId);
foreach(const auto& call, callList) { foreach(const auto& call, callList) {
emit linked.callAddedToConference(call, confId); emit linked.callAddedToConference(call, confId);
// Remove acll from pendingConferences_
pendingConferences_.erase(call);
} }
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment