bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/handlers/whiteboardCleared.js
Oswaldo Acauan ec07b4434d Change cursor and annotation to user streams and add optimistic updates
WIP | Use streams to cursor and optimistic updates

WIP | Use streamss to whiteboard and optimistic updates

WIP | Remove fake delay

Add two way batching (server/client client/server)

Fix null userId exception and remove logs

wip

Add two way batching (server/client client/server) for cursor

Remove message frequency from draw-listeners component since we handle on message publication

Handle clear and undo messages
2018-05-28 14:46:14 -03:00

23 lines
669 B
JavaScript
Executable File

import { check } from 'meteor/check';
import { AnnotationsStreamer } from '/imports/api/annotations';
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.emit('removed', { meetingId, whiteboardId });
return clearAnnotations(meetingId, whiteboardId);
}
AnnotationsStreamer.emit('removed', { meetingId, whiteboardId, userId });
return clearAnnotations(meetingId, whiteboardId, userId);
}