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

24 lines
752 B
JavaScript
Raw Normal View History

2017-12-09 00:40:52 +08:00
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import { extractCredentials } from '/imports/api/common/server/helpers';
2017-12-09 00:40:52 +08:00
export default function ejectUserFromVoice(userId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
2017-12-09 00:40:52 +08:00
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'EjectUserFromVoiceCmdMsg';
const { meetingId, requesterUserId } = extractCredentials(this.userId);
check(meetingId, String);
check(requesterUserId, String);
2017-12-09 00:40:52 +08:00
check(userId, String);
const payload = {
userId,
ejectedBy: requesterUserId,
};
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}