bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/waiting-users/service.js

48 lines
1.3 KiB
JavaScript
Raw Normal View History

import Meetings from '/imports/api/meetings';
import Auth from '/imports/ui/services/auth';
import { makeCall } from '/imports/ui/services/api';
const guestUsersCall = (guestsArray, status) => makeCall('allowPendingUsers', guestsArray, status);
2021-09-04 19:45:52 +08:00
const changeGuestPolicy = (policyRule) => makeCall('changeGuestPolicy', policyRule);
2020-02-04 04:41:12 +08:00
const getGuestPolicy = () => {
const meeting = Meetings.findOne(
{ meetingId: Auth.meetingID },
{ fields: { 'usersProp.guestPolicy': 1 } },
);
return meeting.usersProp.guestPolicy;
};
2021-09-04 19:45:52 +08:00
const isWaitingRoomEnabled = () => getGuestPolicy() === 'ASK_MODERATOR';
const isGuestLobbyMessageEnabled = Meteor.settings.public.app.enableGuestLobbyMessage;
// We use the dynamicGuestPolicy rule for allowing the rememberChoice checkbox
const allowRememberChoice = Meteor.settings.public.app.dynamicGuestPolicy;
const getGuestLobbyMessage = () => {
const meeting = Meetings.findOne(
{ meetingId: Auth.meetingID },
{ fields: { guestLobbyMessage: 1 } },
);
if (meeting) return meeting.guestLobbyMessage;
return '';
};
const setGuestLobbyMessage = (message) => makeCall('setGuestLobbyMessage', message);
export default {
guestUsersCall,
changeGuestPolicy,
2020-02-04 04:41:12 +08:00
getGuestPolicy,
2021-09-04 19:45:52 +08:00
isWaitingRoomEnabled,
isGuestLobbyMessageEnabled,
getGuestLobbyMessage,
setGuestLobbyMessage,
allowRememberChoice,
};