bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/methods/setMobileUser.js

20 lines
635 B
JavaScript
Raw Normal View History

2019-11-20 01:49:18 +08:00
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import setMobile from '../modifiers/setMobile';
import { extractCredentials } from '/imports/api/common/server/helpers';
2019-11-20 01:49:18 +08:00
export default function setMobileUser() {
2021-05-06 00:47:43 +08:00
try {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
2019-11-20 01:49:18 +08:00
2021-05-06 00:47:43 +08:00
check(meetingId, String);
check(requesterUserId, String);
2019-11-20 01:49:18 +08:00
2021-05-06 00:47:43 +08:00
Logger.verbose(`Mobile user ${requesterUserId} from meeting ${meetingId}`);
2019-11-20 01:49:18 +08:00
2021-05-06 00:47:43 +08:00
setMobile(meetingId, requesterUserId);
} catch (err) {
Logger.error(`Exception while invoking method setMobileUser ${err.stack}`);
}
2019-11-20 01:49:18 +08:00
}