2018-07-07 01:00:44 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
2020-02-07 04:47:28 +08:00
|
|
|
import { extractCredentials } from '/imports/api/common/server/helpers';
|
2018-07-07 01:00:44 +08:00
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
export default function requestJoinURL({ breakoutId, userId: userIdToInvite }) {
|
2018-07-07 01:00:44 +08:00
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
const { meetingId, requesterUserId } = extractCredentials(this.userId);
|
2018-07-07 01:00:44 +08:00
|
|
|
|
2019-01-17 01:41:21 +08:00
|
|
|
const userId = userIdToInvite || requesterUserId;
|
2018-07-07 01:00:44 +08:00
|
|
|
const eventName = 'RequestBreakoutJoinURLReqMsg';
|
2018-12-28 00:20:03 +08:00
|
|
|
|
2018-07-07 01:00:44 +08:00
|
|
|
return RedisPubSub.publishUserMessage(
|
|
|
|
CHANNEL, eventName, meetingId, requesterUserId,
|
|
|
|
{
|
|
|
|
meetingId,
|
|
|
|
breakoutId,
|
2018-12-28 00:20:03 +08:00
|
|
|
userId,
|
2018-07-07 01:00:44 +08:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|