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

33 lines
643 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';
2017-09-01 23:26:57 +08:00
export default function sharedWebcam(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: true,
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);
}