2017-08-03 09:24:38 +08:00
|
|
|
import RedisPubSub from '/imports/startup/server/redis2x';
|
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
|
|
|
|
|
|
|
export default function changeWhiteboardAccess(credentials, multiUser) {
|
|
|
|
const REDIS_CONFIG = Meteor.settings.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
|
|
|
const EVENT_NAME = 'ModifyWhiteboardAccessPubMsg';
|
|
|
|
|
|
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
|
|
|
check(requesterToken, String);
|
|
|
|
check(multiUser, Boolean);
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
multiUser,
|
|
|
|
};
|
|
|
|
|
2017-09-12 03:12:39 +08:00
|
|
|
return RedisPubSub.publish(CHANNEL, EVENT_NAME, meetingId, payload, { userId: requesterUserId });
|
2017-08-03 09:24:38 +08:00
|
|
|
}
|