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
notificationButton.visible: appSettings.isActivityCenterEnabled
notificationCount: chatsModel.activityNotificationList.unreadCount + profileModel.contacts.contactRequests.count
notificationCount: chatsModel.activityNotificationList.unreadCount
onSearchButtonClicked: searchPopup.open()
SearchPopup {

View File

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

View File

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