bigbluebutton-Github/bigbluebutton-html5/imports/api/breakouts/server/methods/requestJoinURL.js

26 lines
770 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
2019-01-17 01:41:21 +08:00
export default function requestJoinURL(credentials, { breakoutId, userId: userIdToInvite }) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const { meetingId, requesterUserId, requesterToken } = credentials;
check(meetingId, String);
check(requesterUserId, String);
check(requesterToken, String);
2019-01-17 01:41:21 +08:00
const userId = userIdToInvite || requesterUserId;
const eventName = 'RequestBreakoutJoinURLReqMsg';
2018-12-28 00:20:03 +08:00
return RedisPubSub.publishUserMessage(
CHANNEL, eventName, meetingId, requesterUserId,
{
meetingId,
breakoutId,
2018-12-28 00:20:03 +08:00
userId,
},
);
}