Make os notifications respect our sound setting (#1445)

This removes our custom notification sound in favor of the system sound, and
ensures that the system sound is disabled if the user unchecks the audio
notification option.

// FREEBIE
This commit is contained in:
Lilia 2017-09-07 18:57:15 +02:00 committed by Scott Nonnenberg
parent f389380b26
commit 1b444a5e23
No known key found for this signature in database
GPG key ID: A4931C09644C654B
2 changed files with 4 additions and 8 deletions

Binary file not shown.

View file

@ -12,8 +12,6 @@
MESSAGE : 'message'
};
var sound = new Audio('audio/NewMessage.mp3');
Whisper.Notifications = new (Backbone.Collection.extend({
initialize: function() {
this.on('add', this.update);
@ -34,9 +32,6 @@
return;
}
var audioNotification = storage.get('audio-notification') || false;
if (audioNotification) {
sound.play();
}
var setting = storage.get('notification-setting') || 'message';
if (setting === SETTINGS.OFF) {
@ -70,9 +65,10 @@
break;
}
var notification = new Notification(title, {
body : message,
icon : iconUrl,
tag : 'signal'
body : message,
icon : iconUrl,
tag : 'signal',
silent : !audioNotification
});
notification.onclick = this.onclick.bind(this);
},