Merge pull request #14088 from zhem0004/fixPhoneBan

Fix: Removing phone users always bans them
This commit is contained in:
Anton Georgiev 2022-01-24 15:50:30 -05:00 committed by GitHub
commit 2e72946bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 9 deletions

View File

@ -50,7 +50,7 @@ trait SelectRandomViewerReqMsgHdlr extends RightsManagementTrait {
Users2x.setUserExempted(liveMeeting.users2x, pickedUser, true)
}
}
val userIds = users.map { case (v) => v.intId }
broadcastEvent(msg, userIds, pickedUser)
}

View File

@ -22,10 +22,12 @@ trait EjectUserFromVoiceCmdMsgHdlr extends RightsManagementTrait {
for {
u <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
} yield {
log.info("Ejecting user from voice. meetingId=" + props.meetingProp.intId + " userId=" + u.intId)
VoiceUsers.ban(liveMeeting.voiceUsers, u)
log.info("Ejecting user from voice. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " ban=" + msg.body.banUser)
val event = MsgBuilder.buildEjectUserFromVoiceConfSysMsg(props.meetingProp.intId, props.voiceProp.voiceConf, u.voiceUserId)
outGW.send(event)
if (msg.body.banUser) {
VoiceUsers.ban(liveMeeting.voiceUsers, u)
}
}
}
}

View File

@ -217,7 +217,7 @@ case class EjectUserFromVoiceCmdMsg(
header: BbbClientMsgHeader,
body: EjectUserFromVoiceCmdMsgBody
) extends StandardMsg
case class EjectUserFromVoiceCmdMsgBody(userId: String, ejectedBy: String)
case class EjectUserFromVoiceCmdMsgBody(userId: String, ejectedBy: String, banUser: Boolean)
/**
* Sent by client to mute all users except presenters in the voice conference.

View File

@ -4,7 +4,7 @@ import RedisPubSub from '/imports/startup/server/redis';
import { extractCredentials } from '/imports/api/common/server/helpers';
import Logger from '/imports/startup/server/logger';
export default function ejectUserFromVoice(userId) {
export default function ejectUserFromVoice(userId, banUser) {
try {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
@ -15,10 +15,12 @@ export default function ejectUserFromVoice(userId) {
check(meetingId, String);
check(requesterUserId, String);
check(userId, String);
check(banUser, Boolean);
const payload = {
userId,
ejectedBy: requesterUserId,
banUser,
};
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);

View File

@ -30,9 +30,9 @@ const STARTED_CHAT_LIST_KEY = 'startedChatList';
const CUSTOM_LOGO_URL_KEY = 'CustomLogoUrl';
export const setCustomLogoUrl = path => Storage.setItem(CUSTOM_LOGO_URL_KEY, path);
export const setCustomLogoUrl = (path) => Storage.setItem(CUSTOM_LOGO_URL_KEY, path);
export const setModeratorOnlyMessage = msg => Storage.setItem('ModeratorOnlyMessage', msg);
export const setModeratorOnlyMessage = (msg) => Storage.setItem('ModeratorOnlyMessage', msg);
const getCustomLogoUrl = () => Storage.getItem(CUSTOM_LOGO_URL_KEY);
@ -304,7 +304,7 @@ const isMeetingLocked = (id) => {
let isLocked = false;
if (meeting.lockSettingsProps !== undefined) {
const {lockSettingsProps:lockSettings, usersProp} = meeting;
const { lockSettingsProps: lockSettings, usersProp } = meeting;
if (lockSettings.disableCam
|| lockSettings.disableMic
@ -447,7 +447,7 @@ const assignPresenter = (userId) => { makeCall('assignPresenter', userId); };
const removeUser = (userId, banUser) => {
if (isVoiceOnlyUser(userId)) {
makeCall('ejectUserFromVoice', userId);
makeCall('ejectUserFromVoice', userId, banUser);
} else {
makeCall('removeUser', userId, banUser);
}