Change window alert setting names and defaults

- Notifications.alert_time → Notifications.flash_time,
  more evocative of what these "alerts" actually do

- Change default for the above from 0 to 5, since now push rules already
  control precisely what to enable or disable these alerts for

- Notifications.urgent_alert_time → Notifications.highlight_flash_time,
  "highlight" is the term used in the matrix doc
This commit is contained in:
miruka 2021-01-05 10:57:34 -04:00
parent 0ca8d46eae
commit 1017d02a83
3 changed files with 12 additions and 11 deletions

View File

@ -8,7 +8,6 @@
- profiles missing in notifications
- option to use plaintext notifications
- Notification urgency level (plyer)?
- Rename the alertOn(Mention/Message)ForMsec options, default Message to non-0
- Make local unread counter an optional turned off by default
- Implement fallback QML notifications, usable if dbus isn't available

View File

@ -40,16 +40,18 @@ class Presence:
auto_away_after: int = 60 * 10
class Notifications:
# How long in seconds window alerts will last when a new message
# is posted in a room. On most desktops, this highlights or flashes the
# application in the taskbar or dock.
# Can be set to 0 for no alerts.
# How long in seconds the window will flash in your dock or taskbar when
# a new message, which matches a notification push rule with a
# flash (lightbulb) action, is posted in a room.
# The effect may differ depending on your OS/desktop.
# or dock to be highlighted or to flash.
# Can be set to -1 for alerts that last until the window is focused.
alert_time: float = 0
flash_time: float = 5
# Same as alert_time for urgent messages, e.g. when you are mentioned,
# replied to, or the message contains a keyword.
urgent_alert_time: float = -1
# Same as flash_time, but for messages that match a push rule with a
# highlight (red [+1]) action. By default this includes when your
# name is mentioned, replied to, or messages containing keywords.
highlight_flash_time: float = -1
class Scrolling:
# Use velocity-based kinetic scrolling.

View File

@ -29,8 +29,8 @@ QtObject {
if (urgencyHint) {
const msec =
critical ?
window.settings.Notifications.urgent_alert_time * 1000 :
window.settings.Notifications.alert_time * 1000
window.settings.Notifications.highlight_flash_time * 1000 :
window.settings.Notifications.flash_time * 1000
// -1 ? 0 for no time out : msec
if (msec !== 0) window.alert(msec === -1 ? 0 : msec)