From b5e78822679b037829f489fc2699a4ae21710242 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Fri, 23 Feb 2018 16:53:24 -0500 Subject: [PATCH] Use system notification sounds Alternatively, there is per-platform support for specific sounds, but that would require a larger investment: - macOS: https://github.com/mikaelbr/node-notifier/tree/9420a38fc329c7700eefd35594319bf3a96227a0#all-notification-options-with-their-defaults - Windows: https://docs.microsoft.com/en-us/previous-versions/windows/apps/hh761492(v=win.10) --- js/notifications.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/notifications.js b/js/notifications.js index fb3c76f6a..e8d109457 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -89,11 +89,12 @@ break; } + var shouldPlayNotificationSound = storage.get('audio-notification') || false; if (window.config.polyfillNotifications) { window.nodeNotifier.notify({ title: title, message: message, - sound: false + sound: shouldPlayNotificationSound, }); window.nodeNotifier.on('click', function(notifierObject, options) { last.get('conversationId'); @@ -103,7 +104,7 @@ body : message, icon : iconUrl, tag : 'signal', - silent : true + silent : !shouldPlayNotificationSound, }); notification.onclick = this.onClick.bind(this, last.get('conversationId'));