Skip to content

Commit

Permalink
Merge pull request #13044 from ramonlsouza/issue-12698
Browse files Browse the repository at this point in the history
feat: user leave alerts
  • Loading branch information
pedrobmarin committed Aug 20, 2021
2 parents f3866cf + e59c5f0 commit 17d7275
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
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

0 comments on commit 17d7275

Please sign in to comment.