diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index e75ca513bee..9f6438b2e48 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -57,6 +57,7 @@ StatusSectionLayout { property var blockedContactsModel property var pendingReceivedRequestContactsModel property var pendingSentRequestContactsModel + property var dismissedReceivedRequestContactsModel required property bool isCentralizedMetricsEnabled @@ -245,6 +246,7 @@ StatusSectionLayout { mutualContactsModel: root.mutualContactsModel blockedContactsModel: root.blockedContactsModel pendingReceivedRequestContactsModel: root.pendingReceivedRequestContactsModel + dismissedReceivedRequestContactsModel: root.dismissedReceivedRequestContactsModel pendingSentRequestContactsModel: root.pendingSentRequestContactsModel } } diff --git a/ui/app/AppLayouts/Profile/views/ContactsView.qml b/ui/app/AppLayouts/Profile/views/ContactsView.qml index 38e3641aead..8bc5f05ca63 100644 --- a/ui/app/AppLayouts/Profile/views/ContactsView.qml +++ b/ui/app/AppLayouts/Profile/views/ContactsView.qml @@ -32,6 +32,7 @@ SettingsContentBase { property var blockedContactsModel property var pendingReceivedRequestContactsModel property var pendingSentRequestContactsModel + property var dismissedReceivedRequestContactsModel property alias searchStr: searchBox.text property bool isPending: false @@ -113,13 +114,11 @@ SettingsContentBase { anchors.topMargin: Theme.padding StatusTabButton { - id: contactsBtn leftPadding: Theme.padding width: implicitWidth text: qsTr("Contacts") } StatusTabButton { - id: pendingRequestsBtn objectName: "ContactsView_PendingRequest_Button" width: implicitWidth enabled: !root.pendingReceivedRequestContactsModel.ModelCount.empty || @@ -128,7 +127,12 @@ SettingsContentBase { badge.value: root.pendingReceivedRequestContactsModel.ModelCount.count } StatusTabButton { - id: blockedBtn + objectName: "ContactsView_DismissedRequest_Button" + width: implicitWidth + enabled: !root.dismissedReceivedRequestContactsModel.ModelCount.empty + text: qsTr("Dismissed Requests") + } + StatusTabButton { objectName: "ContactsView_Blocked_Button" width: implicitWidth enabled: !root.blockedContactsModel.ModelCount.empty @@ -251,6 +255,22 @@ SettingsContentBase { } } + // DISMISSED REQUESTS + ContactsListPanel { + Layout.fillWidth: true + searchString: searchBox.text + onOpenContactContextMenu: root.openContextMenu(contactsModel, publicKey) + contactsModel: root.dismissedReceivedRequestContactsModel + panelUsage: Constants.contactsPanelUsage.rejectedReceivedContactRequest + visible: (stackLayout.currentIndex === 2) + onVisibleChanged: { + if (visible) { + stackLayout.height = height; + } + } + onRejectionRemoved: root.contactsStore.acceptContactRequest(publicKey, "") + } + // BLOCKED ContactsListPanel { id: blockedContacts @@ -260,7 +280,7 @@ SettingsContentBase { onOpenContactContextMenu: root.openContextMenu(contactsModel, publicKey) contactsModel: root.blockedContactsModel panelUsage: Constants.contactsPanelUsage.blockedContacts - visible: (stackLayout.currentIndex === 2) + visible: (stackLayout.currentIndex === 3) onVisibleChanged: { if (visible) { stackLayout.height = height; diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index c21dbf6165e..f8debeab636 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -1733,6 +1733,7 @@ Item { blockedContactsModel: contactsModelAdaptor.blockedContacts pendingReceivedRequestContactsModel: contactsModelAdaptor.pendingReceivedRequestContacts pendingSentRequestContactsModel: contactsModelAdaptor.pendingSentRequestContacts + dismissedReceivedRequestContactsModel: contactsModelAdaptor.dimissedReceivedRequestContacts Binding on settingsSubsection { value: profileLoader.settingsSubsection diff --git a/ui/app/mainui/adaptors/ContactsModelAdaptor.qml b/ui/app/mainui/adaptors/ContactsModelAdaptor.qml index 85a43ab0408..0a85fae4f68 100644 --- a/ui/app/mainui/adaptors/ContactsModelAdaptor.qml +++ b/ui/app/mainui/adaptors/ContactsModelAdaptor.qml @@ -75,4 +75,19 @@ QObject { value: Constants.ContactRequestState.Sent } } + + readonly property var dimissedReceivedRequestContacts: SortFilterProxyModel { + sourceModel: root.allContacts ?? null + + filters: [ + ValueFilter { + roleName: "contactRequest" + value: Constants.ContactRequestState.Dismissed + }, + ValueFilter { + roleName: "isBlocked" + value: false + } + ] + } }