From fc5a1adaa500e90b73d2475d633ea0bd1a4e22b5 Mon Sep 17 00:00:00 2001 From: Bohdan Zhemelinskyi Date: Thu, 15 Dec 2022 20:08:49 +0000 Subject: [PATCH] re-apply lock settings fix --- ...hangeLockSettingsInMeetingCmdMsgHdlr.scala | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala index a7e738bfed..9fd98bdfaa 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala @@ -42,6 +42,17 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait { MeetingStatus2x.setPermissions(liveMeeting.status, settings) + // Dial-in + def buildLockMessage(meetingId: String, userId: String, lockedBy: String, locked: Boolean): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId) + val envelope = BbbCoreEnvelope(UserLockedInMeetingEvtMsg.NAME, routing) + val body = UserLockedInMeetingEvtMsgBody(userId, locked, lockedBy) + val header = BbbClientMsgHeader(UserLockedInMeetingEvtMsg.NAME, meetingId, userId) + val event = UserLockedInMeetingEvtMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + if (oldPermissions.disableCam != settings.disableCam) { if (settings.disableCam) { val notifyEvent = MsgBuilder.buildNotifyAllInMeetingEvtMsg( @@ -55,24 +66,6 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait { outGW.send(notifyEvent) LockSettingsUtil.enforceCamLockSettingsForAllUsers(liveMeeting, outGW) - - // Dial-in - def buildLockMessage(meetingId: String, userId: String, lockedBy: String, locked: Boolean): BbbCommonEnvCoreMsg = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId) - val envelope = BbbCoreEnvelope(UserLockedInMeetingEvtMsg.NAME, routing) - val body = UserLockedInMeetingEvtMsgBody(userId, locked, lockedBy) - val header = BbbClientMsgHeader(UserLockedInMeetingEvtMsg.NAME, meetingId, userId) - val event = UserLockedInMeetingEvtMsg(header, body) - - BbbCommonEnvCoreMsg(envelope, event) - } - - VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu => - if (vu.intId.startsWith(IntIdPrefixType.DIAL_IN)) { // only Dial-in users need this - val eventExplicitLock = buildLockMessage(liveMeeting.props.meetingProp.intId, vu.intId, msg.body.setBy, settings.disableMic) - outGW.send(eventExplicitLock) - } - } } else { val notifyEvent = MsgBuilder.buildNotifyAllInMeetingEvtMsg( liveMeeting.props.meetingProp.intId, @@ -97,8 +90,12 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait { Vector() ) outGW.send(notifyEvent) - - // Apply lock settings when disableMic from false to true. + VoiceUsers.findAll(liveMeeting.voiceUsers) foreach { vu => + if (vu.intId.startsWith(IntIdPrefixType.DIAL_IN)) { // only Dial-in users need this + val eventExplicitLock = buildLockMessage(liveMeeting.props.meetingProp.intId, vu.intId, msg.body.setBy, settings.disableMic) + outGW.send(eventExplicitLock) + } + } LockSettingsUtil.enforceLockSettingsForAllVoiceUsers(liveMeeting, outGW) } else { val notifyEvent = MsgBuilder.buildNotifyAllInMeetingEvtMsg(