bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/handlers/whiteboardCleared.js

25 lines
773 B
JavaScript
Raw Normal View History

2016-11-19 01:35:28 +08:00
import { check } from 'meteor/check';
2019-10-23 09:26:25 +08:00
import AnnotationsStreamer from '/imports/api/annotations/server/streamer';
2016-11-19 01:35:28 +08:00
import clearAnnotations from '../modifiers/clearAnnotations';
2016-11-19 01:35:28 +08:00
export default async function handleWhiteboardCleared({ body }, meetingId) {
check(body, {
userId: String,
whiteboardId: String,
fullClear: Boolean,
});
2016-11-19 01:35:28 +08:00
const { whiteboardId, fullClear, userId } = body;
2016-11-19 01:35:28 +08:00
if (fullClear) {
2019-10-23 09:26:25 +08:00
AnnotationsStreamer(meetingId).emit('removed', { meetingId, whiteboardId });
const result = await clearAnnotations(meetingId, whiteboardId);
return result;
}
2019-10-23 09:26:25 +08:00
AnnotationsStreamer(meetingId).emit('removed', { meetingId, whiteboardId, userId });
const result = await clearAnnotations(meetingId, whiteboardId, userId);
return result;
2017-06-03 03:25:02 +08:00
}