Skip to content
Snippets Groups Projects
Commit 55977e74 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

currentcall: setCurrentCall only on active calls

Change-Id: I9f16e8a3633981d41429343885a3130b0496288d
GitLab: #1007
parent 5380a86b
No related branches found
No related tags found
No related merge requests found
...@@ -416,8 +416,6 @@ CallAdapter::acceptACall(const QString& accountId, const QString& convUid) ...@@ -416,8 +416,6 @@ CallAdapter::acceptACall(const QString& accountId, const QString& convUid)
return; return;
lrcInstance_->getAccountInfo(accountId).callModel->accept(convInfo.callId); lrcInstance_->getAccountInfo(accountId).callModel->accept(convInfo.callId);
auto& accInfo = lrcInstance_->getAccountInfo(convInfo.accountId);
accInfo.callModel->setCurrentCall(convInfo.callId);
} }
void void
...@@ -518,7 +516,12 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f ...@@ -518,7 +516,12 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f
if (convInfo.uid == lrcInstance_->get_selectedConvUid()) { if (convInfo.uid == lrcInstance_->get_selectedConvUid()) {
auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId_); auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId_);
if (accInfo.profileInfo.type != lrc::api::profile::Type::SIP) { if (accInfo.profileInfo.type != lrc::api::profile::Type::SIP) {
accInfo.callModel->setCurrentCall(call->id); // Only setCurrentCall if call is actually answered
try {
if (call->status == call::Status::IN_PROGRESS
|| call->status == call::Status::PAUSED)
accInfo.callModel->setCurrentCall(call->id);
} catch (...) {}
} }
} }
......
...@@ -61,8 +61,15 @@ CurrentCall::updateId(QString callId) ...@@ -61,8 +61,15 @@ CurrentCall::updateId(QString callId)
} }
auto& accInfo = lrcInstance_->getCurrentAccountInfo(); auto& accInfo = lrcInstance_->getCurrentAccountInfo();
if (accInfo.profileInfo.type != lrc::api::profile::Type::SIP) if (accInfo.profileInfo.type != lrc::api::profile::Type::SIP) {
accInfo.callModel->setCurrentCall(callId); // Only setCurrentCall if call is actually answered
try {
auto callInfo = accInfo.callModel->getCall(callId);
if (callInfo.status == call::Status::IN_PROGRESS
|| callInfo.status == call::Status::PAUSED)
accInfo.callModel->setCurrentCall(callId);
} catch (...) {}
}
// Set the current id_ if there is a call. // Set the current id_ if there is a call.
set_id((accInfo.callModel->hasCall(callId) ? callId : QString())); set_id((accInfo.callModel->hasCall(callId) ? callId : QString()));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment