bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/handlers/whiteboardCleared.js
2019-10-22 22:26:25 -03:00

23 lines
703 B
JavaScript
Executable File

import { check } from 'meteor/check';
import AnnotationsStreamer from '/imports/api/annotations/server/streamer';
import clearAnnotations from '../modifiers/clearAnnotations';
export default function handleWhiteboardCleared({ body }, meetingId) {
check(body, {
userId: String,
whiteboardId: String,
fullClear: Boolean,
});
const { whiteboardId, fullClear, userId } = body;
if (fullClear) {
AnnotationsStreamer(meetingId).emit('removed', { meetingId, whiteboardId });
return clearAnnotations(meetingId, whiteboardId);
}
AnnotationsStreamer(meetingId).emit('removed', { meetingId, whiteboardId, userId });
return clearAnnotations(meetingId, whiteboardId, userId);
}