diff --git a/bigbluebutton-html5/imports/ui/components/settings/component.jsx b/bigbluebutton-html5/imports/ui/components/settings/component.jsx index c27a3fc662..fcf003f967 100644 --- a/bigbluebutton-html5/imports/ui/components/settings/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/settings/component.jsx @@ -164,6 +164,7 @@ class Settings extends Component { const { intl, isModerator, + showGuestNotification, showToggleLabel, } = this.props; @@ -219,6 +220,7 @@ class Settings extends Component { ({ updateSettings, availableLocales: getAvailableLocales(), isModerator: getUserRoles() === 'MODERATOR', + showGuestNotification: showGuestNotification(), showToggleLabel: false, }))(SettingsContainer); diff --git a/bigbluebutton-html5/imports/ui/components/settings/service.js b/bigbluebutton-html5/imports/ui/components/settings/service.js index 42698cb30c..19c434dda8 100644 --- a/bigbluebutton-html5/imports/ui/components/settings/service.js +++ b/bigbluebutton-html5/imports/ui/components/settings/service.js @@ -2,6 +2,7 @@ import Users from '/imports/api/users'; import Auth from '/imports/ui/services/auth'; import Settings from '/imports/ui/services/settings'; import { notify } from '/imports/ui/services/notification'; +import GuestService from '/imports/ui/components/waiting-users/service'; const getUserRoles = () => { const user = Users.findOne({ @@ -11,6 +12,14 @@ const getUserRoles = () => { return user.role; }; +const showGuestNotification = () => { + const guestPolicy = GuestService.getGuestPolicy(); + + // Guest notification only makes sense when guest + // entrance is being controlled by moderators + return guestPolicy === 'ASK_MODERATOR'; +}; + const updateSettings = (obj, msg) => { Object.keys(obj).forEach(k => (Settings[k] = obj[k])); Settings.save(); @@ -31,6 +40,7 @@ const getAvailableLocales = () => fetch('./locale-list').then(locales => locales export { getUserRoles, + showGuestNotification, updateSettings, getAvailableLocales, }; diff --git a/bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx b/bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx index b058762443..8e2c253763 100644 --- a/bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/settings/submenus/notification/component.jsx @@ -54,8 +54,13 @@ class NotificationMenu extends BaseMenu { render() { const { - intl, isModerator, showToggleLabel, displaySettingsStatus, + intl, + isModerator, + showGuestNotification, + showToggleLabel, + displaySettingsStatus, } = this.props; + const { settings } = this.state; return ( @@ -144,7 +149,7 @@ class NotificationMenu extends BaseMenu { - {isModerator ? ( + {isModerator && showGuestNotification ? (