bigbluebutton-Github/bigbluebutton-html5/imports/api/screenshare/server/modifiers/clearScreenshare.js

23 lines
716 B
JavaScript
Raw Normal View History

import Logger from '/imports/startup/server/logger';
import Screenshare from '/imports/api/screenshare';
export default function clearScreenshare(meetingId, screenshareConf) {
try {
let numberAffected;
2019-03-14 21:15:31 +08:00
if (meetingId && screenshareConf) {
numberAffected = Screenshare.remove({ meetingId, 'screenshare.screenshareConf': screenshareConf });
} else if (meetingId) {
numberAffected = Screenshare.remove({ meetingId });
} else {
numberAffected = Screenshare.remove({});
}
2019-03-14 21:15:31 +08:00
if (numberAffected) {
Logger.info(`removed screenshare meetingId=${meetingId} id=${screenshareConf}`);
}
} catch (err) {
Logger.error(`removing screenshare to collection: ${err}`);
}
}