2017-07-27 23:27:06 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
2017-10-12 10:00:28 +08:00
|
|
|
import Screenshare from '/imports/api/screenshare';
|
2017-07-27 23:27:06 +08:00
|
|
|
|
|
|
|
export default function clearScreenshare(meetingId, screenshareConf) {
|
2019-03-14 21:15:31 +08:00
|
|
|
const cb = (err) => {
|
|
|
|
if (err) {
|
|
|
|
return Logger.error(`removing screenshare to collection: ${err}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Logger.info(`removed screenshare meetingId=${meetingId} id=${screenshareConf}`);
|
|
|
|
};
|
|
|
|
|
2017-07-27 23:27:06 +08:00
|
|
|
if (meetingId && screenshareConf) {
|
2019-03-14 21:15:31 +08:00
|
|
|
return Screenshare.remove({ meetingId, 'screenshare.screenshareConf': screenshareConf }, cb);
|
2017-07-27 23:27:06 +08:00
|
|
|
}
|
2019-03-14 21:15:31 +08:00
|
|
|
return Screenshare.remove({}, cb);
|
2017-07-27 23:27:06 +08:00
|
|
|
}
|