bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/setMobile.js
Pedro Beschorner Marin d7c0975b61 Fix mobile user-list identification
Added the missing extractCredential method and replaced the old callback strategy
with the new try-catch block.
2021-02-08 09:55:38 -03:00

27 lines
561 B
JavaScript

import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
import Users from '/imports/api/users';
export default function setMobile(meetingId, userId) {
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
mobile: true,
},
};
try {
const numberAffected = Users.update(selector, modifier);
if (numberAffected) {
Logger.info(`Assigned mobile user id=${userId} meeting=${meetingId}`);
}
} catch (err) {
Logger.error(`Assigning mobile user: ${err}`);
}
}