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

Add property to settings.yml to enable/disable breakout invitations to moderators #11341

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { extractCredentials } from '/imports/api/common/server/helpers';
export default function createBreakoutRoom(rooms, durationInMinutes, record = false) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const BREAKOUT_LIM = Meteor.settings.public.app.breakoutRoomLimit;
const BREAKOUT_LIM = Meteor.settings.public.app.breakouts.breakoutRoomLimit;
const MIN_BREAKOUT_ROOMS = 2;
const MAX_BREAKOUT_ROOMS = BREAKOUT_LIM > MIN_BREAKOUT_ROOMS ? BREAKOUT_LIM : MIN_BREAKOUT_ROOMS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const intlMessages = defineMessages({
},
});

const BREAKOUT_LIM = Meteor.settings.public.app.breakoutRoomLimit;
const BREAKOUT_LIM = Meteor.settings.public.app.breakouts.breakoutRoomLimit;
const MIN_BREAKOUT_ROOMS = 2;
const MAX_BREAKOUT_ROOMS = BREAKOUT_LIM > MIN_BREAKOUT_ROOMS ? BREAKOUT_LIM : MIN_BREAKOUT_ROOMS;

Expand All @@ -122,7 +122,7 @@ const propTypes = {
formatMessage: PropTypes.func.isRequired,
}).isRequired,
isInvitation: PropTypes.bool.isRequired,
isMe: PropTypes.bool.isRequired,
isMe: PropTypes.func.isRequired,
meetingName: PropTypes.string.isRequired,
users: PropTypes.arrayOf(PropTypes.object).isRequired,
createBreakoutRoom: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Session } from 'meteor/session';
import { withModalMounter } from '/imports/ui/components/modal/service';
import BreakoutJoinConfirmation from '/imports/ui/components/breakout-join-confirmation/container';
import BreakoutService from '../service';

const BREAKOUT_MODAL_DELAY = 200;

Expand Down Expand Up @@ -60,7 +61,6 @@ class BreakoutRoomInvitation extends Component {
currentBreakoutUser,
getBreakoutByUser,
breakoutUserIsIn,
amIModerator,
} = this.props;

const {
Expand All @@ -73,7 +73,7 @@ class BreakoutRoomInvitation extends Component {
closeBreakoutJoinConfirmation(mountModal);
}

if (hasBreakouts && !breakoutUserIsIn && !amIModerator) {
if (hasBreakouts && !breakoutUserIsIn && BreakoutService.checkInviteModerators()) {
// Have to check for freeJoin breakouts first because currentBreakoutUser will
// populate after a room has been joined
const breakoutRoom = getBreakoutByUser(currentBreakoutUser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ export default withTracker(() => ({
getBreakoutByUser: BreakoutService.getBreakoutByUser,
currentBreakoutUser: BreakoutService.getBreakoutUserByUserId(Auth.userID),
breakoutUserIsIn: BreakoutService.getBreakoutUserIsIn(Auth.userID),
amIModerator: BreakoutService.amIModerator(),
}))(BreakoutRoomInvitationContainer);
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ const amIModerator = () => {
return User.role === ROLE_MODERATOR;
};

const checkInviteModerators = () => {
const BREAKOUTS_CONFIG = Meteor.settings.public.app.breakouts;

return !((amIModerator() && !BREAKOUTS_CONFIG.sendInvitationToIncludedModerators));
};

const getBreakoutByUserId = userId => Breakouts.find(
{ 'users.userId': userId },
{ fields: { timeRemaining: 0 } },
Expand Down Expand Up @@ -121,4 +127,5 @@ export default {
getBreakoutByUserId,
getBreakoutUserIsIn,
isUserInBreakoutRoom,
checkInviteModerators,
};
4 changes: 3 additions & 1 deletion bigbluebutton-html5/private/config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public:
# Warning: increasing the limit of breakout rooms per meeting
# can generate excessive overhead to the server. We recommend
# this value to be kept under 12.
breakoutRoomLimit: 8
breakouts:
breakoutRoomLimit: 8
sendInvitationToIncludedModerators: false
# https://github.com/bigbluebutton/bigbluebutton/pull/10826
customHeartbeat: true
defaultSettings:
Expand Down