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';
|
|
|
|
|
|
|
|
export default function ejectUserFromVoice(credentials, userId) {
|
2018-01-08 08:24:05 +08:00
|
|
|
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 { 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);
|
|
|
|
}
|