feat: add setting for notifications on requests
This commit is contained in:
parent
ecf8b241f0
commit
a90257e141
|
@ -184,9 +184,6 @@ ScrollView {
|
|||
onMessageNotificationPushed: function(chatId, msg, messageType, chatType, timestamp, identicon, username, hasMention, isAddedContact, channelName) {
|
||||
if (appSettings.notificationSetting == Constants.notifyAllMessages ||
|
||||
(appSettings.notificationSetting == Constants.notifyJustMentions && hasMention)) {
|
||||
if (chatType === Constants.chatTypeOneToOne && !appSettings.allowNotificationsFromNonContacts && !isAddedContact) {
|
||||
return
|
||||
}
|
||||
if (chatId === chatsModel.activeChannel.id && applicationWindow.active === true) {
|
||||
// Do not show the notif if we are in the channel already and the window is active and focused
|
||||
return
|
||||
|
|
|
@ -122,6 +122,9 @@ Rectangle {
|
|||
Connections {
|
||||
target: profileModel.contacts
|
||||
onContactRequestAdded: {
|
||||
if (!appSettings.notifyOnNewRequests) {
|
||||
return
|
||||
}
|
||||
systemTray.showMessage(qsTr("New contact request"),
|
||||
qsTr("%1 requests to become contacts").arg(Utils.removeStatusEns(name)),
|
||||
SystemTrayIcon.NoIcon,
|
||||
|
|
|
@ -253,12 +253,11 @@ ScrollView {
|
|||
width: parent.width
|
||||
|
||||
StatusSettingsLineButton {
|
||||
//% "Receive notifications from non-contacts"
|
||||
text: qsTrId("receive-notifications-from-non-contacts")
|
||||
text: qsTr("Notify on new requests")
|
||||
isSwitch: true
|
||||
switchChecked: appSettings.allowNotificationsFromNonContacts
|
||||
switchChecked: appSettings.notifyOnNewRequests
|
||||
onClicked: {
|
||||
appSettings.allowNotificationsFromNonContacts = checked
|
||||
appSettings.notifyOnNewRequests = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ RowLayout {
|
|||
property bool notificationSoundsEnabled: true
|
||||
property bool useOSNotifications: true
|
||||
property int notificationMessagePreviewSetting: Constants.notificationPreviewNameAndMessage
|
||||
property bool allowNotificationsFromNonContacts: false
|
||||
property bool notifyOnNewRequests: true
|
||||
property var whitelistedUnfurlingSites: ({})
|
||||
property bool neverAskAboutUnfurlingAgain: false
|
||||
property bool hideChannelSuggestions: false
|
||||
|
|
Loading…
Reference in New Issue