bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/changePin.js
Max Franke 85ad9a5e30 feat(video): webcam video pinning server side logic
Add the new ChangeUserPinState messages to handle the new video pinning
functionality
2021-12-21 16:58:38 -03:00

26 lines
545 B
JavaScript

import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
export default function changePin(meetingId, userId, pin, changedBy) {
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
pin,
},
};
try {
const numberAffected = Users.update(selector, modifier);
if (numberAffected) {
Logger.info(`Change pin=${pin} id=${userId} meeting=${meetingId} changedBy=${changedBy}`);
}
} catch (err) {
Logger.error(`Change pin error: ${err}`);
}
}