Skip to content
Snippets Groups Projects
Commit 7fc1e61c authored by Chad Pilkey's avatar Chad Pilkey
Browse files

user join cue improvements

parent d81fe936
No related branches found
No related tags found
No related merge requests found
......@@ -215,8 +215,19 @@ Base.propTypes = propTypes;
Base.defaultProps = defaultProps;
const BaseContainer = withTracker(() => {
const { locale, animations } = Settings.application;
const { credentials, loggedIn } = Auth;
const {
locale,
animations,
userJoinAudioAlerts,
userJoinPushAlerts,
} = Settings.application;
const {
credentials,
loggedIn,
userID: localUserId,
} = Auth;
const { meetingId } = credentials;
let breakoutRoomSubscriptionHandler;
let meetingModeratorSubscriptionHandler;
......@@ -311,30 +322,32 @@ const BaseContainer = withTracker(() => {
},
});
Users.find({}, { fields: { validated: 1, name: 1 } }).observe({
changed: (newDocument) => {
if (newDocument.validated && newDocument.name) {
if (Settings.application.userJoinAudioAlerts) {
const audio = new Audio(`${Meteor.settings.public.app.cdn + Meteor.settings.public.app.basename}/resources/sounds/userJoin.mp3`);
audio.play();
}
if (Settings.application.userJoinPushAlerts) {
notify(
<FormattedMessage
id="app.notification.userJoinPushAlert"
description="Notification for a user joins the meeting"
values={{
0: newDocument.name,
}}
/>,
'info',
'user',
);
if (userJoinAudioAlerts || userJoinPushAlerts) {
Users.find({}, { fields: { validated: 1, name: 1, userId: 1 } }).observe({
changed: (newDocument) => {
if (newDocument.validated && newDocument.name && newDocument.userId !== localUserId) {
if (userJoinAudioAlerts) {
const audio = new Audio(`${Meteor.settings.public.app.cdn + Meteor.settings.public.app.basename}/resources/sounds/userJoin.mp3`);
audio.play();
}
if (userJoinPushAlerts) {
notify(
<FormattedMessage
id="app.notification.userJoinPushAlert"
description="Notification for a user joins the meeting"
values={{
0: newDocument.name,
}}
/>,
'info',
'user',
);
}
}
}
},
});
},
});
}
return {
approved,
......
......@@ -30,8 +30,8 @@ public:
animations: true
chatAudioAlerts: false
chatPushAlerts: false
userJoinAudioAlerts: true
userJoinPushAlerts: true
userJoinAudioAlerts: false
userJoinPushAlerts: false
fallbackLocale: en
overrideLocale: null
audio:
......
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