8e822f4a6d
A TODO 5 years in the making
20 lines
533 B
JavaScript
20 lines
533 B
JavaScript
import { check } from 'meteor/check';
|
|
import addScreenshare from '../modifiers/addScreenshare';
|
|
import clearScreenshare from '../modifiers/clearScreenshare';
|
|
|
|
export default function handleScreenshareSync({ body }, meetingId) {
|
|
check(meetingId, String);
|
|
check(body, Object);
|
|
|
|
const { isBroadcasting, screenshareConf } = body;
|
|
|
|
check(screenshareConf, String);
|
|
check(isBroadcasting, Boolean);
|
|
|
|
if (!isBroadcasting) {
|
|
return clearScreenshare(meetingId, screenshareConf);
|
|
}
|
|
|
|
return addScreenshare(meetingId, body);
|
|
}
|