Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: user leave alerts #13044

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions bigbluebutton-html5/imports/startup/client/base.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,39 @@ class Base extends Component {
);
}
},
removed: (user) => {
const subscriptionsReady = Session.get('subscriptionsReady');

if (!subscriptionsReady) return;

const {
userLeaveAudioAlerts,
userLeavePushAlerts,
} = Settings.application;

if (!userLeaveAudioAlerts && !userLeavePushAlerts) return;

if (userLeaveAudioAlerts) {
AudioService.playAlertSound(`${Meteor.settings.public.app.cdn
+ Meteor.settings.public.app.basename
+ Meteor.settings.public.app.instanceId}`
+ '/resources/sounds/notify.mp3');
}

if (userLeavePushAlerts) {
notify(
<FormattedMessage
id="app.notification.userLeavePushAlert"
description="Notification for a user leaves the meeting"
values={{
0: user.name,
}}
/>,
'info',
'user',
);
}
},
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ const propTypes = {
chatAudioAlerts: PropTypes.bool,
chatPushAlerts: PropTypes.bool,
userJoinAudioAlerts: PropTypes.bool,
userLeaveAudioAlerts: PropTypes.bool,
userLeavePushAlerts: PropTypes.bool,
guestWaitingAudioAlerts: PropTypes.bool,
guestWaitingPushAlerts: PropTypes.bool,
paginationEnabled: PropTypes.bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const intlMessages = defineMessages({
id: 'app.submenu.notification.userJoinLabel',
description: 'label for chat messages',
},
userLeaveLabel: {
id: 'app.submenu.notification.userLeaveLabel',
description: 'label for user leave notifications',
},
guestWaitingLabel: {
id: 'app.submenu.notification.guestWaitingLabel',
description: 'label for guests waiting for approval',
Expand Down Expand Up @@ -149,6 +153,38 @@ class NotificationMenu extends BaseMenu {
</div>
</div>

<div className={styles.row}>
<div className={styles.col}>
<label className={styles.label}>
{intl.formatMessage(intlMessages.userLeaveLabel)}
</label>
</div>
<div className={styles.col}>
<div className={cx(styles.formElement, styles.pullContentCenter)}>
{displaySettingsStatus(settings.userLeaveAudioAlerts)}
<Toggle
icons={false}
defaultChecked={settings.userLeaveAudioAlerts}
onChange={() => this.handleToggle('userLeaveAudioAlerts')}
ariaLabel={`${intl.formatMessage(intlMessages.userLeaveLabel)} ${intl.formatMessage(intlMessages.audioAlertLabel)}`}
showToggleLabel={showToggleLabel}
/>
</div>
</div>
<div className={styles.col}>
<div className={cx(styles.formElement, styles.pullContentCenter)}>
{displaySettingsStatus(settings.userLeavePushAlerts)}
<Toggle
icons={false}
defaultChecked={settings.userLeavePushAlerts}
onChange={() => this.handleToggle('userLeavePushAlerts')}
ariaLabel={`${intl.formatMessage(intlMessages.userLeaveLabel)} ${intl.formatMessage(intlMessages.pushAlertLabel)}`}
showToggleLabel={showToggleLabel}
/>
</div>
</div>
</div>

{isModerator && showGuestNotification ? (
<div className={styles.row}>
<div className={styles.col}>
Expand Down
2 changes: 2 additions & 0 deletions bigbluebutton-html5/private/config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public:
chatPushAlerts: false
userJoinAudioAlerts: false
userJoinPushAlerts: false
userLeaveAudioAlerts: false
userLeavePushAlerts: false
raiseHandAudioAlerts: true
raiseHandPushAlerts: true
guestWaitingAudioAlerts: true
Expand Down
2 changes: 2 additions & 0 deletions bigbluebutton-html5/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
"app.submenu.notification.pushAlertLabel": "Popup Alerts",
"app.submenu.notification.messagesLabel": "Chat Message",
"app.submenu.notification.userJoinLabel": "User Join",
"app.submenu.notification.userLeaveLabel": "User Leave",
"app.submenu.notification.guestWaitingLabel": "Guest Waiting Approval",
"app.submenu.audio.micSourceLabel": "Microphone source",
"app.submenu.audio.speakerSourceLabel": "Speaker source",
Expand Down Expand Up @@ -616,6 +617,7 @@
"app.notification.recordingPaused": "This session is not being recorded anymore",
"app.notification.recordingAriaLabel": "Recorded time ",
"app.notification.userJoinPushAlert": "{0} joined the session",
"app.notification.userLeavePushAlert": "{0} left the session",
"app.submenu.notification.raiseHandLabel": "Raise hand",
"app.shortcut-help.title": "Keyboard shortcuts",
"app.shortcut-help.accessKeyNotAvailable": "Access keys not available",
Expand Down