From 4cb563085fc857b275a79cbddb581e036b3ee247 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Mon, 21 Mar 2022 15:25:41 -0300 Subject: [PATCH] Implements param lockSettingsHideViewersCursor --- .../core/apps/pads/PadCreateGroupReqMsgHdlr.scala | 4 ++-- .../ChangeLockSettingsInMeetingCmdMsgHdlr.scala | 4 +++- .../apps/users/GetLockSettingsReqMsgHdlr.scala | 3 ++- .../bigbluebutton/core/running/MeetingActor.scala | 3 ++- .../org/bigbluebutton/core2/MeetingStatus2x.scala | 3 ++- .../bigbluebutton/common2/domain/Meeting2x.scala | 3 ++- .../org/bigbluebutton/common2/msgs/UsersMsgs.scala | 6 +++--- .../main/java/org/bigbluebutton/api/ApiParams.java | 1 + .../org/bigbluebutton/api/ParamsProcessorUtil.java | 14 +++++++++++++- .../api/domain/LockSettingsParams.java | 5 ++++- .../org/bigbluebutton/api2/BbbWebApiGWApp.scala | 7 ++++--- .../meetings/server/methods/toggleLockSettings.js | 3 +++ .../api/meetings/server/modifiers/addMeeting.js | 1 + .../server/modifiers/changeLockSettings.js | 3 +++ .../ui/components/lock-viewers/context/context.js | 1 + .../grails-app/conf/bigbluebutton.properties | 1 + .../grails-app/conf/spring/resources.xml | 3 ++- 17 files changed, 49 insertions(+), 16 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadCreateGroupReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadCreateGroupReqMsgHdlr.scala index faee9130dc..95fa6ccffa 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadCreateGroupReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/pads/PadCreateGroupReqMsgHdlr.scala @@ -22,9 +22,9 @@ trait PadCreateGroupReqMsgHdlr { } val padEnabled = msg.body.model match { - case "notes" => !liveMeeting.props.meetingProp.disabledFeatures.contains("sharedNotes") + case "notes" => !liveMeeting.props.meetingProp.disabledFeatures.contains("sharedNotes") case "captions" => !liveMeeting.props.meetingProp.disabledFeatures.contains("captions") - case _ => false + case _ => false } if (padEnabled && !Pads.hasGroup(liveMeeting.pads, msg.body.externalId)) { 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 0517248f0d..5478b9329a 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 @@ -29,7 +29,8 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait { hideUserList = msg.body.hideUserList, lockedLayout = msg.body.lockedLayout, lockOnJoin = msg.body.lockOnJoin, - lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable + lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable, + hideViewersCursor = msg.body.hideViewersCursor ) if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) { @@ -67,6 +68,7 @@ trait ChangeLockSettingsInMeetingCmdMsgHdlr extends RightsManagementTrait { lockedLayout = settings.lockedLayout, lockOnJoin = settings.lockOnJoin, lockOnJoinConfigurable = settings.lockOnJoinConfigurable, + hideViewersCursor = settings.hideViewersCursor, msg.body.setBy ) val header = BbbClientMsgHeader( diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetLockSettingsReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetLockSettingsReqMsgHdlr.scala index d8e82645f1..ec0517332c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetLockSettingsReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetLockSettingsReqMsgHdlr.scala @@ -24,7 +24,8 @@ trait GetLockSettingsReqMsgHdlr { hideUserList = settings.hideUserList, lockedLayout = settings.lockedLayout, lockOnJoin = settings.lockOnJoin, - lockOnJoinConfigurable = settings.lockOnJoinConfigurable + lockOnJoinConfigurable = settings.lockOnJoinConfigurable, + hideViewersCursor = settings.hideViewersCursor ) val header = BbbClientMsgHeader(GetLockSettingsRespMsg.NAME, meetingId, requestedBy) val event = GetLockSettingsRespMsg(header, body) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index c05141da72..05c96ddb0d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -297,7 +297,8 @@ class MeetingActor( hideUserList = lockSettingsProp.hideUserList, lockedLayout = lockSettingsProp.lockedLayout, lockOnJoin = lockSettingsProp.lockOnJoin, - lockOnJoinConfigurable = lockSettingsProp.lockOnJoinConfigurable + lockOnJoinConfigurable = lockSettingsProp.lockOnJoinConfigurable, + hideViewersCursor = lockSettingsProp.hideViewersCursor ) MeetingStatus2x.initializePermissions(liveMeeting.status) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala index d00578605e..ea227a50da 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/MeetingStatus2x.scala @@ -13,7 +13,8 @@ case class Permissions( hideUserList: Boolean = false, lockedLayout: Boolean = false, lockOnJoin: Boolean = true, - lockOnJoinConfigurable: Boolean = false + lockOnJoinConfigurable: Boolean = false, + hideViewersCursor: Boolean = false ) case class MeetingExtensionProp(maxExtensions: Int = 2, numExtensions: Int = 0, extendByMinutes: Int = 20, diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala index b066c50e04..6de881f33e 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala @@ -59,7 +59,8 @@ case class LockSettingsProps( hideUserList: Boolean, lockedLayout: Boolean, lockOnJoin: Boolean, - lockOnJoinConfigurable: Boolean + lockOnJoinConfigurable: Boolean, + hideViewersCursor: Boolean ) case class SystemProps( diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala index 511e175707..ef47d8d966 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMsgs.scala @@ -253,7 +253,7 @@ case class ChangeLockSettingsInMeetingCmdMsg( ) extends StandardMsg case class ChangeLockSettingsInMeetingCmdMsgBody(disableCam: Boolean, disableMic: Boolean, disablePrivChat: Boolean, disablePubChat: Boolean, disableNotes: Boolean, hideUserList: Boolean, lockedLayout: Boolean, lockOnJoin: Boolean, - lockOnJoinConfigurable: Boolean, setBy: String) + lockOnJoinConfigurable: Boolean, hideViewersCursor: Boolean, setBy: String) object LockSettingsInMeetingChangedEvtMsg { val NAME = "LockSettingsInMeetingChangedEvtMsg" } case class LockSettingsInMeetingChangedEvtMsg( @@ -262,7 +262,7 @@ case class LockSettingsInMeetingChangedEvtMsg( ) extends BbbCoreMsg case class LockSettingsInMeetingChangedEvtMsgBody(disableCam: Boolean, disableMic: Boolean, disablePrivChat: Boolean, disablePubChat: Boolean, disableNotes: Boolean, hideUserList: Boolean, lockedLayout: Boolean, lockOnJoin: Boolean, - lockOnJoinConfigurable: Boolean, setBy: String) + lockOnJoinConfigurable: Boolean, hideViewersCursor: Boolean, setBy: String) /** * Sent by client to query the lock settings. @@ -278,7 +278,7 @@ object GetLockSettingsRespMsg { val NAME = "GetLockSettingsRespMsg" } case class GetLockSettingsRespMsg(header: BbbClientMsgHeader, body: GetLockSettingsRespMsgBody) extends BbbCoreMsg case class GetLockSettingsRespMsgBody(disableCam: Boolean, disableMic: Boolean, disablePrivChat: Boolean, disablePubChat: Boolean, disableNotes: Boolean, hideUserList: Boolean, lockedLayout: Boolean, lockOnJoin: Boolean, - lockOnJoinConfigurable: Boolean) + lockOnJoinConfigurable: Boolean, hideViewersCursor: Boolean) object LockSettingsNotInitializedRespMsg { val NAME = "LockSettingsNotInitializedRespMsg" } case class LockSettingsNotInitializedRespMsg(header: BbbClientMsgHeader, body: LockSettingsNotInitializedRespMsgBody) extends BbbCoreMsg diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java index 4c82e4384f..be1d069aa5 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ApiParams.java @@ -83,6 +83,7 @@ public class ApiParams { public static final String LOCK_SETTINGS_LOCKED_LAYOUT = "lockSettingsLockedLayout"; public static final String LOCK_SETTINGS_LOCK_ON_JOIN = "lockSettingsLockOnJoin"; public static final String LOCK_SETTINGS_LOCK_ON_JOIN_CONFIGURABLE = "lockSettingsLockOnJoinConfigurable"; + public static final String LOCK_SETTINGS_HIDE_VIEWERS_CURSOR = "lockSettingsHideViewersCursor"; // New param passed on create call to callback when meeting ends. // This is a duplicate of the endCallbackUrl meta param as we want this diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index 5aee7a81c1..a1828ff187 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -113,6 +113,7 @@ public class ParamsProcessorUtil { private boolean defaultLockSettingsLockedLayout; private boolean defaultLockSettingsLockOnJoin; private boolean defaultLockSettingsLockOnJoinConfigurable; + private boolean defaultLockSettingsHideViewersCursor; private Long maxPresentationFileUpload = 30000000L; // 30MB @@ -335,6 +336,12 @@ public class ParamsProcessorUtil { lockSettingsLockOnJoinConfigurable = Boolean.parseBoolean(lockSettingsLockOnJoinConfigurableParam); } + Boolean lockSettingsHideViewersCursor = defaultLockSettingsHideViewersCursor; + String lockSettingsHideViewersCursorParam = params.get(ApiParams.LOCK_SETTINGS_HIDE_VIEWERS_CURSOR); + if (!StringUtils.isEmpty(lockSettingsHideViewersCursorParam)) { + lockSettingsHideViewersCursor = Boolean.parseBoolean(lockSettingsHideViewersCursorParam); + } + return new LockSettingsParams(lockSettingsDisableCam, lockSettingsDisableMic, lockSettingsDisablePrivateChat, @@ -343,7 +350,8 @@ public class ParamsProcessorUtil { lockSettingsHideUserList, lockSettingsLockedLayout, lockSettingsLockOnJoin, - lockSettingsLockOnJoinConfigurable); + lockSettingsLockOnJoinConfigurable, + lockSettingsHideViewersCursor); } private ArrayList processGroupsParams(Map params) { @@ -1298,6 +1306,10 @@ public class ParamsProcessorUtil { this.defaultLockSettingsLockOnJoinConfigurable = lockSettingsLockOnJoinConfigurable; } + public void setLockSettingsHideViewersCursor(Boolean lockSettingsHideViewersCursor) { + this.defaultLockSettingsHideViewersCursor = lockSettingsHideViewersCursor; + } + public void setAllowDuplicateExtUserid(Boolean allow) { this.defaultAllowDuplicateExtUserid = allow; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/LockSettingsParams.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/LockSettingsParams.java index 4df8e0be94..61f27e90e8 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/LockSettingsParams.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/LockSettingsParams.java @@ -10,6 +10,7 @@ public class LockSettingsParams { public final Boolean lockedLayout; public final Boolean lockOnJoin; public final Boolean lockOnJoinConfigurable; + public final Boolean hideViewersCursor; public LockSettingsParams(Boolean disableCam, Boolean disableMic, @@ -19,7 +20,8 @@ public class LockSettingsParams { Boolean hideUserList, Boolean lockedLayout, Boolean lockOnJoin, - Boolean lockOnJoinConfigurable) { + Boolean lockOnJoinConfigurable, + Boolean hideViewersCursor) { this.disableCam = disableCam; this.disableMic = disableMic; this.disablePrivateChat = disablePrivateChat; @@ -29,5 +31,6 @@ public class LockSettingsParams { this.lockedLayout = lockedLayout; this.lockOnJoin = lockOnJoin; this.lockOnJoinConfigurable = lockOnJoinConfigurable; + this.hideViewersCursor = hideViewersCursor; } } diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala index 08f24ab734..b692e69211 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala @@ -123,8 +123,8 @@ class BbbWebApiGWApp( autoStartRecording: java.lang.Boolean, allowStartStopRecording: java.lang.Boolean, webcamsOnlyForModerator: java.lang.Boolean, meetingCameraCap: java.lang.Integer, - userCameraCap: java.lang.Integer, - moderatorPass: String, viewerPass: String, learningDashboardAccessToken: String, + userCameraCap: java.lang.Integer, + moderatorPass: String, viewerPass: String, learningDashboardAccessToken: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean, sequence: java.lang.Integer, freeJoin: java.lang.Boolean, @@ -204,7 +204,8 @@ class BbbWebApiGWApp( hideUserList = lockSettingsParams.hideUserList.booleanValue(), lockedLayout = lockSettingsParams.lockedLayout.booleanValue(), lockOnJoin = lockSettingsParams.lockOnJoin.booleanValue(), - lockOnJoinConfigurable = lockSettingsParams.lockOnJoinConfigurable.booleanValue() + lockOnJoinConfigurable = lockSettingsParams.lockOnJoinConfigurable.booleanValue(), + hideViewersCursor = lockSettingsParams.hideViewersCursor.booleanValue() ) val systemProps = SystemProps( diff --git a/bigbluebutton-html5/imports/api/meetings/server/methods/toggleLockSettings.js b/bigbluebutton-html5/imports/api/meetings/server/methods/toggleLockSettings.js index 83dc259d47..d13afb089b 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/methods/toggleLockSettings.js +++ b/bigbluebutton-html5/imports/api/meetings/server/methods/toggleLockSettings.js @@ -24,6 +24,7 @@ export default function toggleLockSettings(lockSettingsProps) { lockedLayout: Boolean, lockOnJoin: Boolean, lockOnJoinConfigurable: Boolean, + hideViewersCursor: Boolean, setBy: Match.Maybe(String), }); @@ -37,6 +38,7 @@ export default function toggleLockSettings(lockSettingsProps) { lockedLayout, lockOnJoin, lockOnJoinConfigurable, + hideViewersCursor, } = lockSettingsProps; const payload = { @@ -49,6 +51,7 @@ export default function toggleLockSettings(lockSettingsProps) { lockedLayout, lockOnJoin, lockOnJoinConfigurable, + hideViewersCursor, setBy: requesterUserId, }; diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js index f08fc4d786..bd597c624e 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js @@ -112,6 +112,7 @@ export default function addMeeting(meeting) { lockOnJoin: Boolean, lockOnJoinConfigurable: Boolean, lockedLayout: Boolean, + hideViewersCursor: Boolean, }, systemProps: { html5InstanceId: Number, diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/changeLockSettings.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/changeLockSettings.js index a3ba8d5509..c6d4a1e76d 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/changeLockSettings.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/changeLockSettings.js @@ -14,6 +14,7 @@ export default function changeLockSettings(meetingId, payload) { lockedLayout: Boolean, lockOnJoin: Boolean, lockOnJoinConfigurable: Boolean, + hideViewersCursor: Boolean, setBy: Match.Maybe(String), }); @@ -27,6 +28,7 @@ export default function changeLockSettings(meetingId, payload) { lockedLayout, lockOnJoin, lockOnJoinConfigurable, + hideViewersCursor, setBy, } = payload; @@ -46,6 +48,7 @@ export default function changeLockSettings(meetingId, payload) { lockedLayout, lockOnJoin, lockOnJoinConfigurable, + hideViewersCursor, setBy, }, }, diff --git a/bigbluebutton-html5/imports/ui/components/lock-viewers/context/context.js b/bigbluebutton-html5/imports/ui/components/lock-viewers/context/context.js index d8d2f45aa6..aa7d12e7ee 100644 --- a/bigbluebutton-html5/imports/ui/components/lock-viewers/context/context.js +++ b/bigbluebutton-html5/imports/ui/components/lock-viewers/context/context.js @@ -12,6 +12,7 @@ export function LockStruct() { lockOnJoin: true, lockOnJoinConfigurable: false, lockedLayout: false, + hideViewersCursor: false, }, userLocks: { userWebcam: false, diff --git a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties index 725dab67e3..53f6ddffb3 100755 --- a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties +++ b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties @@ -397,6 +397,7 @@ lockSettingsHideUserList=false lockSettingsLockedLayout=false lockSettingsLockOnJoin=true lockSettingsLockOnJoinConfigurable=false +lockSettingsHideViewersCursor=false allowDuplicateExtUserid=true diff --git a/bigbluebutton-web/grails-app/conf/spring/resources.xml b/bigbluebutton-web/grails-app/conf/spring/resources.xml index 4755b77d81..40c2bba669 100755 --- a/bigbluebutton-web/grails-app/conf/spring/resources.xml +++ b/bigbluebutton-web/grails-app/conf/spring/resources.xml @@ -171,7 +171,7 @@ with BigBlueButton; if not, see . - + @@ -183,6 +183,7 @@ with BigBlueButton; if not, see . +