|
|
|
@ -14,6 +14,7 @@ import { getUserPreference } from '../../../utils'; |
|
|
|
|
import { getUserAvatarURL } from '../../../utils/lib/getUserAvatarURL'; |
|
|
|
|
import { getAvatarAsPng } from '../../../ui-utils'; |
|
|
|
|
import { promises } from '../../../promises/client'; |
|
|
|
|
import { CustomSounds } from '../../../custom-sounds/client/lib/CustomSounds'; |
|
|
|
|
|
|
|
|
|
export const KonchatNotification = { |
|
|
|
|
notificationStatus: new ReactiveVar(), |
|
|
|
@ -107,17 +108,13 @@ export const KonchatNotification = { |
|
|
|
|
|
|
|
|
|
if (sub && sub.audioNotificationValue !== 'none') { |
|
|
|
|
if (sub && sub.audioNotificationValue) { |
|
|
|
|
const [audio] = $(`audio#${ sub.audioNotificationValue }`); |
|
|
|
|
if (audio && audio.play) { |
|
|
|
|
audio.volume = Number((audioVolume / 100).toPrecision(2)); |
|
|
|
|
return audio.play(); |
|
|
|
|
} |
|
|
|
|
CustomSounds.play(sub.audioNotificationValue, { |
|
|
|
|
volume: Number((audioVolume / 100).toPrecision(2)), |
|
|
|
|
}); |
|
|
|
|
} else if (newMessageNotification !== 'none') { |
|
|
|
|
const [audio] = $(`audio#${ newMessageNotification }`); |
|
|
|
|
if (audio && audio.play) { |
|
|
|
|
audio.volume = Number((audioVolume / 100).toPrecision(2)); |
|
|
|
|
return audio.play(); |
|
|
|
|
} |
|
|
|
|
CustomSounds.play(newMessageNotification, { |
|
|
|
|
volume: Number((audioVolume / 100).toPrecision(2)), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -161,11 +158,9 @@ Meteor.startup(() => { |
|
|
|
|
if ((Session.get('newRoomSound') || []).length > 0) { |
|
|
|
|
Meteor.defer(function() { |
|
|
|
|
if (newRoomNotification !== 'none') { |
|
|
|
|
const [audio] = $(`audio#${ newRoomNotification }`); |
|
|
|
|
if (audio && audio.play) { |
|
|
|
|
audio.volume = Number((audioVolume / 100).toPrecision(2)); |
|
|
|
|
return audio.play(); |
|
|
|
|
} |
|
|
|
|
CustomSounds.play(newRoomNotification, { |
|
|
|
|
volume: Number((audioVolume / 100).toPrecision(2)), |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|