bigbluebutton-Github/bigbluebutton-html5/imports/api/meetings/server/modifiers/setGuestLobbyMessage.js
Pedro Beschorner Marin 0365018e92 Add guest lobby messages
Moderators are able to send a message to the meeting's guest lobby. This new
event reaches bbb-web and is sent to the guest user with her/his status response
while polling. All guest users that are waiting for acceptance will be able to
read this message.

enableGuestLobbyMessage is disabled by default.
2021-03-09 11:02:25 -03:00

33 lines
821 B
JavaScript

import Meetings from '/imports/api/meetings';
import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
export default function setGuestLobbyMessage(meetingId, guestLobbyMessage) {
check(meetingId, String);
check(guestLobbyMessage, String);
const selector = {
meetingId,
};
const modifier = {
$set: {
guestLobbyMessage,
},
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Changing meeting guest lobby message: ${err}`);
}
if (!numChanged) {
return Logger.info(`Meeting's ${meetingId} guest lobby message=${guestLobbyMessage} wasn't updated`);
}
return Logger.info(`Meeting's ${meetingId} guest lobby message=${guestLobbyMessage} updated`);
};
return Meetings.update(selector, modifier, cb);
}