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) Users2x.setUserExempted(liveMeeting.users2x, pickedUser, true)
} }
} }
val userIds = users.map { case (v) => v.intId } val userIds = users.map { case (v) => v.intId }
broadcastEvent(msg, userIds, pickedUser) broadcastEvent(msg, userIds, pickedUser)
} }

View File

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

View File

@ -217,7 +217,7 @@ case class EjectUserFromVoiceCmdMsg(
header: BbbClientMsgHeader, header: BbbClientMsgHeader,
body: EjectUserFromVoiceCmdMsgBody body: EjectUserFromVoiceCmdMsgBody
) extends StandardMsg ) 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. * 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 { extractCredentials } from '/imports/api/common/server/helpers';
import Logger from '/imports/startup/server/logger'; import Logger from '/imports/startup/server/logger';
export default function ejectUserFromVoice(userId) { export default function ejectUserFromVoice(userId, banUser) {
try { try {
const REDIS_CONFIG = Meteor.settings.private.redis; const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
@ -15,10 +15,12 @@ export default function ejectUserFromVoice(userId) {
check(meetingId, String); check(meetingId, String);
check(requesterUserId, String); check(requesterUserId, String);
check(userId, String); check(userId, String);
check(banUser, Boolean);
const payload = { const payload = {
userId, userId,
ejectedBy: requesterUserId, ejectedBy: requesterUserId,
banUser,
}; };
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); 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'; 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); const getCustomLogoUrl = () => Storage.getItem(CUSTOM_LOGO_URL_KEY);
@ -304,7 +304,7 @@ const isMeetingLocked = (id) => {
let isLocked = false; let isLocked = false;
if (meeting.lockSettingsProps !== undefined) { if (meeting.lockSettingsProps !== undefined) {
const {lockSettingsProps:lockSettings, usersProp} = meeting; const { lockSettingsProps: lockSettings, usersProp } = meeting;
if (lockSettings.disableCam if (lockSettings.disableCam
|| lockSettings.disableMic || lockSettings.disableMic
@ -447,7 +447,7 @@ const assignPresenter = (userId) => { makeCall('assignPresenter', userId); };
const removeUser = (userId, banUser) => { const removeUser = (userId, banUser) => {
if (isVoiceOnlyUser(userId)) { if (isVoiceOnlyUser(userId)) {
makeCall('ejectUserFromVoice', userId); makeCall('ejectUserFromVoice', userId, banUser);
} else { } else {
makeCall('removeUser', userId, banUser); makeCall('removeUser', userId, banUser);
} }