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) {
|
2020-11-25 04:44:13 +08:00
|
|
|
try {
|
|
|
|
let numberAffected;
|
2019-03-14 21:15:31 +08:00
|
|
|
|
2020-11-25 04:44:13 +08:00
|
|
|
if (meetingId && screenshareConf) {
|
|
|
|
numberAffected = Screenshare.remove({ meetingId, 'screenshare.screenshareConf': screenshareConf });
|
2021-02-10 00:44:49 +08:00
|
|
|
} else if (meetingId) {
|
|
|
|
numberAffected = Screenshare.remove({ meetingId });
|
2020-11-25 04:44:13 +08:00
|
|
|
} else {
|
|
|
|
numberAffected = Screenshare.remove({});
|
|
|
|
}
|
2019-03-14 21:15:31 +08:00
|
|
|
|
2020-11-25 04:44:13 +08:00
|
|
|
if (numberAffected) {
|
|
|
|
Logger.info(`removed screenshare meetingId=${meetingId} id=${screenshareConf}`);
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`removing screenshare to collection: ${err}`);
|
2017-07-27 23:27:06 +08:00
|
|
|
}
|
|
|
|
}
|