Fix "Mentions & keywords" notification level

Make it work in cases where multiple accounts are present in the room
and one of them is highlighted.
This commit is contained in:
miruka
2020-09-19 15:42:25 -04:00
parent e8d8f7fe0b
commit 54234399f5
5 changed files with 12 additions and 9 deletions

View File

@@ -11,12 +11,17 @@ QtObject {
Qt.exit(exitCode)
}
function onNotificationRequested(title, body, image, highImportance) {
function onNotificationRequested(id, title, body, image, highImportance) {
const level = window.notificationLevel
if (Qt.application.state === Qt.ApplicationActive) return
if (level === Window.NotificationLevel.None) return
if (level === Window.MentionsKeywords && ! highImportance) return
if (window.notifiedIds.has(id)) return
window.notifiedIds.add(id)
window.notifiedIdsChanged()
if (Qt.application.state === Qt.ApplicationActive) return
py.callCoro("desktop_notify", [title, body, image])