chore(act-center): hide contact requests from the activity center

This commit is contained in:
Jonathan Rainville 2021-07-27 13:59:01 -04:00 committed by Iuri Matias
parent e2d91dc66b
commit a37ce0b133
3 changed files with 36 additions and 37 deletions

View File

@ -234,7 +234,7 @@ Item {
membersButton.visible: appSettings.showOnlineUsers && chatsModel.channelView.activeChannel.chatType !== Constants.chatTypeOneToOne membersButton.visible: appSettings.showOnlineUsers && chatsModel.channelView.activeChannel.chatType !== Constants.chatTypeOneToOne
notificationButton.visible: appSettings.isActivityCenterEnabled notificationButton.visible: appSettings.isActivityCenterEnabled
notificationCount: chatsModel.activityNotificationList.unreadCount + profileModel.contacts.contactRequests.count notificationCount: chatsModel.activityNotificationList.unreadCount
onSearchButtonClicked: searchPopup.open() onSearchButtonClicked: searchPopup.open()
SearchPopup { SearchPopup {

View File

@ -18,7 +18,7 @@ Popup {
property int currentFilter: ActivityCenter.Filter.All property int currentFilter: ActivityCenter.Filter.All
property bool hasMentions: false property bool hasMentions: false
property bool hasReplies: false property bool hasReplies: false
property bool hasContactRequests: contactList.count > 0 // property bool hasContactRequests: false
property bool hideReadNotifications: false property bool hideReadNotifications: false
@ -70,31 +70,31 @@ Popup {
} }
// TODO remove this once it is handled by the activity center // TODO remove this once it is handled by the activity center
Repeater { // Repeater {
id: contactList // id: contactList
model: profileModel.contacts.contactRequests // model: profileModel.contacts.contactRequests
delegate: ContactRequest { // delegate: ContactRequest {
visible: !hideReadNotifications && // visible: !hideReadNotifications &&
(activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests) // (activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests)
name: Utils.removeStatusEns(model.name) // name: Utils.removeStatusEns(model.name)
address: model.address // address: model.address
localNickname: model.localNickname // localNickname: model.localNickname
identicon: model.thumbnailImage || model.identicon // identicon: model.thumbnailImage || model.identicon
// TODO set to transparent bg if the notif is read // // TODO set to transparent bg if the notif is read
color: Utils.setColorAlpha(Style.current.blue, 0.1) // color: Utils.setColorAlpha(Style.current.blue, 0.1)
radius: 0 // radius: 0
profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) { // profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
var popup = profilePopupComponent.createObject(contactList); // var popup = profilePopupComponent.createObject(contactList);
popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName); // popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName);
} // }
onBlockContactActionTriggered: { // onBlockContactActionTriggered: {
blockContactConfirmationDialog.contactName = name // blockContactConfirmationDialog.contactName = name
blockContactConfirmationDialog.contactAddress = address // blockContactConfirmationDialog.contactAddress = address
blockContactConfirmationDialog.open() // blockContactConfirmationDialog.open()
} // }
} // }
} // }
Repeater { Repeater {
model: notifDelegateList model: notifDelegateList
@ -129,7 +129,6 @@ Popup {
hasReplies = true hasReplies = true
} }
break break
} }
} }

View File

@ -50,16 +50,16 @@ Item {
onClicked: activityCenter.currentFilter = ActivityCenter.Filter.Replies onClicked: activityCenter.currentFilter = ActivityCenter.Filter.Replies
} }
StatusButton { // StatusButton {
id: contactRequestsBtn // id: contactRequestsBtn
//% "Contact requests" // //% "Contact requests"
text: qsTrId("contact-requests") // text: qsTrId("contact-requests")
enabled: hasContactRequests // enabled: hasContactRequests
type: "secondary" // type: "secondary"
size: "small" // size: "small"
highlighted: activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests // highlighted: activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
onClicked: activityCenter.currentFilter = ActivityCenter.Filter.ContactRequests // onClicked: activityCenter.currentFilter = ActivityCenter.Filter.ContactRequests
} // }
} }
Row { Row {