Add notification options to room context menu

This commit is contained in:
miruka
2021-02-28 09:00:36 -04:00
parent 716b480550
commit af321d8eae
3 changed files with 83 additions and 2 deletions

View File

@@ -136,6 +136,9 @@ HTile {
}
contextMenu: HMenu {
// This delegate is only used for nested menus
delegate: HMenuItem { icon.name: "room-menu-notifications" }
HMenuItem {
icon.name: model.pinned ? "room-unpin": "room-pin"
text: model.pinned ? qsTr("Unpin"): qsTr("Pin to top")
@@ -144,6 +147,40 @@ HTile {
)
}
HMenu {
title: qsTr("Notifications")
HMenuItem {
text: qsTr("Use default account settings")
onTriggered: py.callClientCoro(
model.for_account, "room_pushrule_use_default", [model.id],
)
}
HMenuItem {
text: qsTr("All new messages")
onTriggered: py.callClientCoro(
model.for_account, "room_pushrule_all_events", [model.id],
)
}
HMenuItem {
text: qsTr("Highlights only (replies, keywords...)")
onTriggered: py.callClientCoro(
model.for_account,
"room_pushrule_highlights_only",
[model.id],
)
}
HMenuItem {
text: qsTr("Ignore new messages")
onTriggered: py.callClientCoro(
model.for_account, "room_pushrule_ignore_all", [model.id],
)
}
}
HMenuItemPopupSpawner {
visible: joined
enabled: model.can_invite && accountModel.presence !== "offline"