bigbluebutton-Github/bigbluebutton-html5/imports/api/voice-users/server/methods/ejectUserFromVoice.js
2017-12-08 11:40:52 -05:00

23 lines
664 B
JavaScript

import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
export default function ejectUserFromVoice(credentials, userId) {
const REDIS_CONFIG = Meteor.settings.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'EjectUserFromVoiceCmdMsg';
const { requesterUserId, meetingId } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(userId, String);
const payload = {
userId,
ejectedBy: requesterUserId,
};
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}