From 90ad29c78e86a699397d8a1afee74920267b99e8 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 18 Aug 2025 14:23:38 +0200 Subject: [PATCH] fix forwarding message #LINQT-1877 --- .../view/Control/Display/Chat/ChatListView.qml | 2 +- .../view/Page/Form/Chat/SelectedChatView.qml | 4 +--- Linphone/view/Page/Main/Chat/ChatPage.qml | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Linphone/view/Control/Display/Chat/ChatListView.qml b/Linphone/view/Control/Display/Chat/ChatListView.qml index 8d0639a9a..b9c636192 100644 --- a/Linphone/view/Control/Display/Chat/ChatListView.qml +++ b/Linphone/view/Control/Display/Chat/ChatListView.qml @@ -19,7 +19,7 @@ ListView { property ChatGui currentChatGui onCurrentIndexChanged: currentChatGui = model.getAt(currentIndex) || null - onCurrentChatGuiChanged: chatClicked(currentChatGui) + onChatClicked: (chat) => {currentChatGui = chat} signal resultsReceived() signal markAllAsRead() diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index 28c48bbc5..ae576cf95 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -679,7 +679,6 @@ FocusScope { checkable: true checked: true icon.source: checked ? AppIcons.upArrow : AppIcons.downArrow - KeyNavigation.down: contentControl } } ChatListView { @@ -694,7 +693,6 @@ FocusScope { } } AllContactListView { - visible: expandContactButton.checked Layout.fillWidth: true itemsRightMargin: 0 showActions: false @@ -703,7 +701,7 @@ FocusScope { searchBarText: forwardSearchBar.text Layout.preferredHeight: contentHeight onContactSelected: contact => selectedFriend = contact - property FriendGui selectedFriend + property FriendGui selectedFriend: null property var chatForSelectedAddressObj: selectedFriend ? UtilsCpp.getChatForAddress(selectedFriend.core.defaultAddress) : null property ChatGui chatForAddress: chatForSelectedAddressObj ? chatForSelectedAddressObj.value : null onChatForAddressChanged: if(chatForAddress) { diff --git a/Linphone/view/Page/Main/Chat/ChatPage.qml b/Linphone/view/Page/Main/Chat/ChatPage.qml index 47c2a3039..08890f87a 100644 --- a/Linphone/view/Page/Main/Chat/ChatPage.qml +++ b/Linphone/view/Page/Main/Chat/ChatPage.qml @@ -187,8 +187,8 @@ AbstractMainPage { searchBar: searchBar Control.ScrollBar.vertical: scrollbar - onChatClicked: (chat) => { - mainItem.selectedChatGui = chat + onCurrentChatGuiChanged: { + mainItem.selectedChatGui = currentChatGui } Connections { @@ -331,10 +331,21 @@ AbstractMainPage { id: currentChatComp FocusScope { SelectedChatView { + id: selectedChatView visible: chat != undefined && chat != null anchors.fill: parent - onChatChanged: if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat chat: mainItem.selectedChatGui ? mainItem.selectedChatGui : null + onChatChanged: { + if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat + } + // Binding is destroyed when forward message is done so + // we need this connection in addition + Connections { + target: mainItem + function onSelectedChatGuiChanged() { + selectedChatView.chat = mainItem.selectedChatGui + } + } } } }