bigbluebutton-Github/bigbluebutton-html5/imports/api/shapes/server/handlers/whiteboardGetReply.js
2016-11-18 17:35:28 +00:00

26 lines
650 B
JavaScript

import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
import { inReplyToHTML5Client } from '/imports/api/common/server/helpers';
import addShape from '../modifiers/addShape';
export default function handleWhiteboardGetReply({ payload }) {
if (!inReplyToHTML5Client({ payload })) {
return;
}
const meetingId = payload.meeting_id;
const shapes = payload.shapes;
check(meetingId, String);
check(shapes, Array);
let shapesAdded = [];
shapes.forEach(shape => {
let whiteboardId = shape.wb_id;
shapesAdded.push(addShape(meetingId, whiteboardId, shape));
});
return shapesAdded;
};