diff --git a/src/calladapter.cpp b/src/calladapter.cpp index 99bfd008eaa07065eef94a9fe701ec4eb0b7862f..0174a9cc6d569c24a51e34bcaef313759a1fbec4 100644 --- a/src/calladapter.cpp +++ b/src/calladapter.cpp @@ -207,7 +207,9 @@ CallAdapter::onShowCallView(const QString& accountId, const QString& convUid) if (convInfo.uid.isEmpty()) { return; } + updateCall(convInfo.uid, accountId); + emit callSetupMainViewRequired(accountId, convInfo.uid); } void @@ -226,7 +228,6 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f return; } - emit callSetupMainViewRequired(accountId_, convUid_); updateCallOverlay(convInfo); emit previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly)); @@ -423,11 +424,14 @@ CallAdapter::connectCallModel(const QString& accountId) /* * Reset the call view corresponding accountId, uid. */ - lrcInstance_->setSelectedConvId(otherConv.uid); updateCall(otherConv.uid, otherConv.accountId, forceCallOnly); + + emit callSetupMainViewRequired(accountId, convInfo.uid); } } } + + return; } preventScreenSaver(false); break; diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index 0a5ffa9dbf5cc2924ea6edb322a497ca8c42c923..35857a6f37efb3208768a12d77f20df5fa6cb356 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -200,7 +200,7 @@ Rectangle { currentConvUID = currentUID if (callState === Call.Status.IN_PROGRESS || callState === Call.Status.PAUSED) { - UtilsAdapter.setCurrentCall(AccountAdapter.currentAccountId, currentUID) + CallAdapter.updateCall(currentUID, AccountAdapter.currentAccountId) if (isAudioOnly) callStackView.showAudioCallPage() else diff --git a/src/utilsadapter.cpp b/src/utilsadapter.cpp index d886a0f4e052937565aa22a258ee990f82307f5c..f885a7b0bfa51a55889278949ceae5ff2d0ec9b4 100644 --- a/src/utilsadapter.cpp +++ b/src/utilsadapter.cpp @@ -189,14 +189,6 @@ UtilsAdapter::getAccountListSize() return getCurrAccList().size(); } -void -UtilsAdapter::setCurrentCall(const QString& accountId, const QString& convUid) -{ - auto& accInfo = lrcInstance_->getAccountInfo(accountId); - auto const& convInfo = lrcInstance_->getConversationFromConvUid(convUid, accountId); - accInfo.callModel->setCurrentCall(convInfo.callId); -} - bool UtilsAdapter::hasCall(const QString& accountId) { diff --git a/src/utilsadapter.h b/src/utilsadapter.h index 8d4fe6add1031488c9481e4ca6453a0617d1b35b..5eb3d29c13d6d09a80c4eeae840c740df0c83c99 100644 --- a/src/utilsadapter.h +++ b/src/utilsadapter.h @@ -58,7 +58,6 @@ public: Q_INVOKABLE void makePermanentCurrentConv(); Q_INVOKABLE const QStringList getCurrAccList(); Q_INVOKABLE int getAccountListSize(); - Q_INVOKABLE void setCurrentCall(const QString& accountId, const QString& convUid); Q_INVOKABLE bool hasCall(const QString& accountId); Q_INVOKABLE const QString getCallConvForAccount(const QString& accountId); Q_INVOKABLE const QString getCallId(const QString& accountId, const QString& convUid);