diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx index 6b29e66e1c3982009bed2daadb67e0da60d3a688..5d00ae901c2788bbc3977c2e5683c2acdf6de54b 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx @@ -99,6 +99,10 @@ const messages = defineMessages({ id: 'app.userList.menu.directoryLookup.label', description: 'Directory lookup', }, + handAlertLabel: { + id: 'app.userList.handAlert', + description: 'text displayed in raise hand toast', + }, }); const propTypes = { @@ -114,6 +118,7 @@ const propTypes = { }; const CHAT_ENABLED = Meteor.settings.public.chat.enabled; const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator; +const MAX_ALERT_RANGE = 550; class UserDropdown extends PureComponent { /** @@ -482,6 +487,7 @@ class UserDropdown extends PureComponent { renderUserAvatar() { const { + intl, normalizeEmojiName, user, currentUser, @@ -503,12 +509,15 @@ class UserDropdown extends PureComponent { const iconVoiceOnlyUser = (<Icon iconName="audio_on" />); const userIcon = isVoiceOnly ? iconVoiceOnlyUser : iconUser; + const shouldAlert = user.emoji === 'raiseHand' + && currentUser.userId !== user.userId + && new Date() - user.emojiTime < MAX_ALERT_RANGE; - if (user.emoji === 'raiseHand' && currentUser.userId !== user.userId && user.emojiTime - Date.now() > 0) { + if (shouldAlert) { if (raiseHandAudioAlert) this.audio.play(); if (raiseHandPushAlert) { notify( - `${user.name} has raised their hand`, 'info', 'hand', + `${user.name} ${intl.formatMessage(messages.handAlertLabel)}`, 'info', 'hand', ); } } diff --git a/bigbluebutton-html5/private/locales/en.json b/bigbluebutton-html5/private/locales/en.json index cad7c5d73827d12cd7808858a6a48d4fef66cf3b..44e35fb4e95e7708f2a39543a5c18b32430f5e6e 100755 --- a/bigbluebutton-html5/private/locales/en.json +++ b/bigbluebutton-html5/private/locales/en.json @@ -60,6 +60,7 @@ "app.userList.messagesTitle": "Messages", "app.userList.notesTitle": "Notes", "app.userList.notesListItem.unreadContent": "New content is available in the shared notes section", + "app.userList.handAlert": "has raised their hand", "app.userList.captionsTitle": "Captions", "app.userList.presenter": "Presenter", "app.userList.you": "You",