This commit adds the ability to set the master push rule and set push rules for individual rooms as per the matrix spec. See https://spec.matrix.org/v1.3/client-server-api/#push-rules. The master push rule is just on/off and uses the existing notification setting in general setting to enable/disable the server default master push rule .m.rule.master. For each room there is now a page in the room setting that allows the following to be set: - Default - All messages - @mentions and keywords - off New room or override rules are added/removed to achieve this. There is also functionality to check the master/room notification state whenever the setting menu is entered. This allows the status to be updated if changed in another client or get the initial state for a room as it isn't stored. Note - There is currently no menu items in the room list for setting the room push rule settings. This will be added in a later commit, the aim is to focus on making sure the technical implementation is good for now.
48 lines
1.5 KiB
QML
48 lines
1.5 KiB
QML
// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
import QtQuick 2.15
|
|
import org.kde.kirigami 2.18 as Kirigami
|
|
import QtQuick.Layouts 1.15
|
|
|
|
Kirigami.CategorizedSettings {
|
|
objectName: "settingsPage"
|
|
actions: [
|
|
Kirigami.SettingAction {
|
|
text: i18n("General")
|
|
icon.name: "org.kde.neochat"
|
|
page: Qt.resolvedUrl("GeneralSettingsPage.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("Appearance")
|
|
icon.name: "preferences-desktop-theme-global"
|
|
page: Qt.resolvedUrl("AppearanceSettingsPage.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("Accounts")
|
|
icon.name: "preferences-system-users"
|
|
page: Qt.resolvedUrl("AccountsPage.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("Custom Emojis")
|
|
icon.name: "preferences-desktop-emoticons"
|
|
page: Qt.resolvedUrl("Emoticons.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("Spell Checking")
|
|
iconName: "tools-check-spelling"
|
|
page: Qt.resolvedUrl("SonnetConfigPage.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("Devices")
|
|
iconName: "network-connect"
|
|
page: Qt.resolvedUrl("DevicesPage.qml")
|
|
},
|
|
Kirigami.SettingAction {
|
|
text: i18n("About NeoChat")
|
|
icon.name: "help-about"
|
|
page: Qt.resolvedUrl("About.qml")
|
|
}
|
|
]
|
|
}
|