You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-25 17:02:04 +03:00
Make audio notifs only play if the sound tweak is set
This commit is contained in:
@ -35,7 +35,7 @@ var Notifier = {
|
||||
return TextForEvent.textForEvent(ev);
|
||||
},
|
||||
|
||||
displayNotification: function(ev, room) {
|
||||
displayNotification: function(ev, room, actions) {
|
||||
if (!global.Notification || global.Notification.permission != 'granted') {
|
||||
return;
|
||||
}
|
||||
@ -94,7 +94,9 @@ var Notifier = {
|
||||
};
|
||||
|
||||
var audioClip;
|
||||
audioClip = playAudio();
|
||||
if (actions.tweaks.sound) {
|
||||
audioClip = playAudio();
|
||||
}
|
||||
|
||||
global.setTimeout(function() {
|
||||
notification.close();
|
||||
@ -207,7 +209,7 @@ var Notifier = {
|
||||
|
||||
var actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
|
||||
if (actions && actions.notify) {
|
||||
this.displayNotification(ev, room);
|
||||
this.displayNotification(ev, room, actions);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -216,4 +218,4 @@ if (!global.mxNotifier) {
|
||||
global.mxNotifier = Notifier;
|
||||
}
|
||||
|
||||
module.exports = global.mxNotifier;
|
||||
module.exports = global.mxNotifier;
|
||||
|
Reference in New Issue
Block a user