Skip to content
Snippets Groups Projects
Commit 41bd51d3 authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #5958 from RocketChat/fix-sound-issues

Fix sound issues
parents 1864f372 8eb9d024
No related merge requests found
......@@ -61,9 +61,9 @@
sub = ChatSubscription.findOne({ rid: rid }, { fields: { audioNotification: 1 } });
if sub?.audioNotification isnt 'none'
if sub?.audioNotification
$("audio##{sub.audioNotification}")[0].play()
$("audio##{sub.audioNotification}")?[0]?.play?()
else if newMessageNotification isnt 'none'
$("audio##{newMessageNotification}")[0].play()
$("audio##{newMessageNotification}")?[0]?.play?()
newRoom: (rid, withSound = true) ->
Tracker.nonreactive ->
......
RocketChat.Migrations.add({
version: 86,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ newMessageNotification: false }, { $set: { newMessageNotification: 'none' } }, { multi: true });
RocketChat.models.Users.update({ newMessageNotification: true }, { $unset: { newMessageNotification: 1 } }, { multi: true });
RocketChat.models.Users.update({ newRoomNotification: false }, { $set: { newRoomNotification: 'none' } }, { multi: true });
RocketChat.models.Users.update({ newRoomNotification: true }, { $unset: { newRoomNotification: 1 } }, { multi: true });
}
// Disabled this migration for it was not updating any user
}
});
RocketChat.Migrations.add({
version: 87,
up: function() {
if (RocketChat && RocketChat.models && RocketChat.models.Users) {
RocketChat.models.Users.update({ 'settings.preferences.newMessageNotification': false }, { $set: { 'settings.preferences.newMessageNotification': 'none' } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newMessageNotification': true }, { $unset: { 'settings.preferences.newMessageNotification': 1 } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newRoomNotification': false }, { $set: { 'settings.preferences.newRoomNotification': 'none' } }, { multi: true });
RocketChat.models.Users.update({ 'settings.preferences.newRoomNotification': true }, { $unset: { 'settings.preferences.newRoomNotification': 1 } }, { multi: true });
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment