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:
Binary file not shown.
@@ -12,8 +12,6 @@
|
|||||||
MESSAGE : 'message'
|
MESSAGE : 'message'
|
||||||
};
|
};
|
||||||
|
|
||||||
var sound = new Audio('audio/NewMessage.mp3');
|
|
||||||
|
|
||||||
Whisper.Notifications = new (Backbone.Collection.extend({
|
Whisper.Notifications = new (Backbone.Collection.extend({
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.on('add', this.update);
|
this.on('add', this.update);
|
||||||
@@ -34,9 +32,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var audioNotification = storage.get('audio-notification') || false;
|
var audioNotification = storage.get('audio-notification') || false;
|
||||||
if (audioNotification) {
|
|
||||||
sound.play();
|
|
||||||
}
|
|
||||||
|
|
||||||
var setting = storage.get('notification-setting') || 'message';
|
var setting = storage.get('notification-setting') || 'message';
|
||||||
if (setting === SETTINGS.OFF) {
|
if (setting === SETTINGS.OFF) {
|
||||||
@@ -72,7 +67,8 @@
|
|||||||
var notification = new Notification(title, {
|
var notification = new Notification(title, {
|
||||||
body : message,
|
body : message,
|
||||||
icon : iconUrl,
|
icon : iconUrl,
|
||||||
tag : 'signal'
|
tag : 'signal',
|
||||||
|
silent : !audioNotification
|
||||||
});
|
});
|
||||||
notification.onclick = this.onclick.bind(this);
|
notification.onclick = this.onclick.bind(this);
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user