From 1b56c4aa0f129d2a40deb51489214d9f1ba7e660 Mon Sep 17 00:00:00 2001 From: Andreas Traczyk Date: Tue, 18 May 2021 13:15:25 -0400 Subject: [PATCH] calls: fix returning to main view from setting while in a call This fixes the call stack view not being reset when exiting the settings. Gitlab: #417 Change-Id: I1af534a1a164a28e1d29b9a4064cc0c78496557c --- src/calladapter.cpp | 3 +++ src/lrcinstance.cpp | 5 +++++ src/mainview/MainView.qml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/calladapter.cpp b/src/calladapter.cpp index 6690934f..6d537d78 100644 --- a/src/calladapter.cpp +++ b/src/calladapter.cpp @@ -232,6 +232,9 @@ CallAdapter::onShowIncomingCallView(const QString& accountId, const QString& con if (call.isOutgoing) { if (isCallSelected) { // don't reselect + // TODO: this signal can be renamed to conversationReselected, + // isCallSelected and any other similar logic can be removed + // and calling selectConversation should be sufficient Q_EMIT lrcInstance_->conversationUpdated(convInfo.uid, accountId); } } else { diff --git a/src/lrcinstance.cpp b/src/lrcinstance.cpp index 582a0b32..6ee2435f 100644 --- a/src/lrcinstance.cpp +++ b/src/lrcinstance.cpp @@ -434,6 +434,11 @@ LRCInstance::poplastConference(const QString& confId) void LRCInstance::selectConversation(const QString& convId, const QString& accountId) { + // reselection can be used to update the conversation + if (convId == selectedConvUid_ && accountId == currentAccountId_) { + Q_EMIT conversationUpdated(convId, accountId); + return; + } // if the account is not currently selected, do that first, then // proceed to select the conversation if (!accountId.isEmpty() && accountId != getCurrentAccountId()) { diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index 3cae7564..0aa36c03 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -138,7 +138,7 @@ Rectangle { if (checkCurrentCall && currentAccountIsCalling()) { var callConv = UtilsAdapter.getCallConvForAccount( LRCInstance.currentAccountId) - LRCInstance.selectConversation(callConv) + LRCInstance.selectConversation(callConv, currentAccountId) CallAdapter.updateCall(callConv, currentAccountId) } else { showWelcomeView()