2018-11-09 02:55:12 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import RedisPubSub from '/imports/startup/server/redis';
|
|
|
|
|
|
|
|
export default function toggleLockSettings(credentials, meeting) {
|
|
|
|
const REDIS_CONFIG = Meteor.settings.private.redis;
|
|
|
|
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
|
|
|
|
const EVENT_NAME = 'ChangeLockSettingsInMeetingCmdMsg';
|
|
|
|
|
|
|
|
const { meetingId, requesterUserId } = credentials;
|
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
2018-11-22 00:39:34 +08:00
|
|
|
check(meeting.lockSettingsProp, {
|
|
|
|
disableCam: Boolean,
|
|
|
|
disableMic: Boolean,
|
|
|
|
disablePrivChat: Boolean,
|
|
|
|
disablePubChat: Boolean,
|
|
|
|
lockedLayout: Boolean,
|
|
|
|
lockOnJoin: Boolean,
|
|
|
|
lockOnJoinConfigurable: Boolean,
|
2019-02-04 23:56:07 +08:00
|
|
|
setBy: Match.Maybe(String),
|
2018-11-22 00:39:34 +08:00
|
|
|
});
|
2018-11-09 02:55:12 +08:00
|
|
|
|
|
|
|
const payload = {
|
|
|
|
disableCam: meeting.lockSettingsProp.disableCam,
|
|
|
|
disableMic: meeting.lockSettingsProp.disableMic,
|
|
|
|
disablePrivChat: meeting.lockSettingsProp.disablePrivChat,
|
|
|
|
disablePubChat: meeting.lockSettingsProp.disablePubChat,
|
|
|
|
lockedLayout: meeting.lockSettingsProp.lockedLayout,
|
|
|
|
lockOnJoin: meeting.lockSettingsProp.lockOnJoin,
|
|
|
|
lockOnJoinConfigurable: meeting.lockSettingsProp.lockOnJoinConfigurable,
|
|
|
|
setBy: requesterUserId,
|
|
|
|
};
|
|
|
|
|
|
|
|
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
|
|
|
|
}
|