2017-08-01 02:48:56 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
2017-10-12 10:00:28 +08:00
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
2017-08-01 02:48:56 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
|
|
|
export default function userJoin(meetingId, userId, authToken) {
|
2018-01-08 08:24:05 +08:00
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
2017-08-01 02:48:56 +08:00
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
|
|
|
const EVENT_NAME = 'UserJoinMeetingReqMsg';
|
|
|
|
|
|
|
|
check(authToken, String);
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
userId,
|
|
|
|
authToken,
|
2018-06-27 03:27:42 +08:00
|
|
|
clientType: 'HTML5',
|
2017-08-01 02:48:56 +08:00
|
|
|
};
|
|
|
|
|
2020-02-07 04:47:28 +08:00
|
|
|
Logger.info(`User='${userId}' is joining meeting='${meetingId}' authToken='${authToken}'`);
|
2017-08-01 02:48:56 +08:00
|
|
|
|
2017-09-12 23:52:02 +08:00
|
|
|
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, userId, payload);
|
2017-09-08 00:47:20 +08:00
|
|
|
}
|