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';
|
2021-02-08 20:55:38 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2019-11-20 01:49:18 +08:00
|
|
|
|
2021-02-08 20:55:38 +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
|
|
|
}
|