bigbluebutton-Github/bigbluebutton-html5/imports/api/users/server/modifiers/addDialInUser.js

33 lines
818 B
JavaScript
Raw Normal View History

2018-08-16 20:21:13 +08:00
import { check } from 'meteor/check';
import addUser from '/imports/api/users/server/modifiers/addUser';
export default async function addDialInUser(meetingId, voiceUser) {
2018-08-16 20:21:13 +08:00
check(meetingId, String);
check(voiceUser, Object);
const USER_CONFIG = Meteor.settings.public.user;
const ROLE_VIEWER = USER_CONFIG.role_viewer;
const { intId, callerName, color } = voiceUser;
2018-08-16 20:21:13 +08:00
const voiceOnlyUser = {
intId,
extId: intId, // TODO
name: callerName,
role: ROLE_VIEWER.toLowerCase(),
2022-01-20 02:35:04 +08:00
guest: true,
2018-08-16 20:21:13 +08:00
authed: true,
2022-02-03 05:07:18 +08:00
waitingForAcceptance: false,
guestStatus: 'ALLOW',
2018-08-16 20:21:13 +08:00
emoji: 'none',
presenter: false,
locked: false, // TODO
avatar: '',
color,
pin: false,
2018-08-16 20:21:13 +08:00
clientType: 'dial-in-user',
};
const user = await addUser(meetingId, voiceOnlyUser);
return user;
2018-08-16 20:21:13 +08:00
}