bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/voice-users/server/modifiers/removeVoiceUser.js
2017-08-01 10:55:00 -03:00

36 lines
754 B
JavaScript

import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import VoiceUsers from '/imports/api/2.0/voice-users';
export default function removeVoiceUser(meetingId, voiceUser) {
check(meetingId, String);
check(voiceUser, {
voiceConf: String,
voiceUserId: String,
intId: String,
});
const { intId } = voiceUser;
const selector = {
meetingId,
intId,
};
const modifier = {
muted: false,
talking: false,
listenOnly: false,
};
const cb = (err) => {
if (err) {
return Logger.error(`Remove voiceUser=${intId}: ${err}`);
}
return Logger.verbose(`Remove voiceUser=${intId} meeting=${meetingId}`);
};
return VoiceUsers.update(selector, modifier, cb);
}