bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/breakouts/server/handlers/breakoutStarted.js

38 lines
799 B
JavaScript
Raw Normal View History

2017-07-14 04:21:27 +08:00
import Breakouts from '/imports/api/2.0/breakouts';
2017-06-27 20:27:57 +08:00
import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
export default function handleBreakoutRoomStarted({ body }) {
const {
meetingId,
externalMeetingId,
} = body.breakout;
const timeRemaining = 15;
check(meetingId, String);
const selector = {
breakoutMeetingId: meetingId,
};
const modifier = {
$set: {
users: [],
timeRemaining: Number(timeRemaining),
externalMeetingId,
},
};
2017-07-14 04:21:27 +08:00
const cb = (err) => {
2017-06-27 20:27:57 +08:00
if (err) {
return Logger.error(`updating breakout: ${err}`);
}
2017-07-14 04:21:27 +08:00
return Logger.info('Updated timeRemaining and externalMeetingId ' +
`for breakout id=${meetingId}`);
2017-06-27 20:27:57 +08:00
};
return Breakouts.update(selector, modifier, cb);
}