bigbluebutton-Github/bigbluebutton-html5/imports/api/video/server/modifiers/unsharedWebcam.js

34 lines
684 B
JavaScript
Raw Normal View History

2017-09-01 23:26:57 +08:00
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
import { check } from 'meteor/check';
2017-09-01 23:26:57 +08:00
export default function unsharedWebcam(meetingId, userId) {
check(meetingId, String);
check(userId, String);
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
meetingId,
userId,
2017-09-19 21:53:27 +08:00
has_stream: false,
2017-09-01 23:26:57 +08:00
},
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Adding user to collection: ${err}`);
}
if (numChanged) {
return Logger.info(`Upserted user id=${userId} meeting=${meetingId}`);
}
};
return Users.upsert(selector, modifier, cb);
}