diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetWebcamsOnlyForModeratorReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetWebcamsOnlyForModeratorReqMsgHdlr.scala new file mode 100644 index 0000000000000000000000000000000000000000..8f626f74b98470c735f35093eed981bf7032aff1 --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/GetWebcamsOnlyForModeratorReqMsgHdlr.scala @@ -0,0 +1,29 @@ +package org.bigbluebutton.core.apps.users + +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } +import org.bigbluebutton.core2.MeetingStatus2x + +trait GetWebcamsOnlyForModeratorReqMsgHdlr { + this: UsersApp => + + val liveMeeting: LiveMeeting + val outGW: OutMsgRouter + + def handleGetWebcamsOnlyForModeratorReqMsg(msg: GetWebcamsOnlyForModeratorReqMsg) { + + def buildGetWebcamsOnlyForModeratorRespMsg(meetingId: String, userId: String, webcamsOnlyForModerator: Boolean): BbbCommonEnvCoreMsg = { + val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, userId) + val envelope = BbbCoreEnvelope(GetWebcamsOnlyForModeratorRespMsg.NAME, routing) + val body = GetWebcamsOnlyForModeratorRespMsgBody(webcamsOnlyForModerator, userId) + val header = BbbClientMsgHeader(GetWebcamsOnlyForModeratorRespMsg.NAME, meetingId, userId) + val event = GetWebcamsOnlyForModeratorRespMsg(header, body) + + BbbCommonEnvCoreMsg(envelope, event) + } + + val event = buildGetWebcamsOnlyForModeratorRespMsg(liveMeeting.props.meetingProp.intId, msg.body.requestedBy, + MeetingStatus2x.webcamsOnlyForModeratorEnabled(liveMeeting.status)) + outGW.send(event) + } +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala index 8c33281e2916a915a1f986fce37d15d9e02b8574..f2c0442bb856ec5c2b895e0a6be249440e497a13 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala @@ -21,6 +21,7 @@ class UsersApp( with SetRecordingStatusCmdMsgHdlr with UpdateWebcamsOnlyForModeratorCmdMsgHdlr with GetRecordingStatusReqMsgHdlr + with GetWebcamsOnlyForModeratorReqMsgHdlr with AssignPresenterReqMsgHdlr with EjectUserFromMeetingCmdMsgHdlr { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 30115db341a52baf35843326f5589e15c82b76f4..9a25bebf62c6b85e8de6e10ae3e2a1fa30c89f1c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -241,6 +241,8 @@ class ReceivedJsonMsgHandlerActor( routeGenericMsg[GetRecordingStatusReqMsg](envelope, jsonNode) case GetScreenshareStatusReqMsg.NAME => routeGenericMsg[GetScreenshareStatusReqMsg](envelope, jsonNode) + case GetWebcamsOnlyForModeratorReqMsg.NAME => + routeGenericMsg[GetWebcamsOnlyForModeratorReqMsg](envelope, jsonNode) case UpdateWebcamsOnlyForModeratorCmdMsg.NAME => routeGenericMsg[UpdateWebcamsOnlyForModeratorCmdMsg](envelope, jsonNode) 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 4786d3d18c38111374ce13cd8e3fe3f13c35b18f..36bbb22d7f22cf74c57275f5886efaa48a97cd02 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 @@ -204,6 +204,7 @@ class MeetingActor( state = usersApp.handleMeetingActivityResponseCmdMsg(m, state) case m: LogoutAndEndMeetingCmdMsg => usersApp.handleLogoutAndEndMeetingCmdMsg(m, state) case m: SetRecordingStatusCmdMsg => usersApp.handleSetRecordingStatusCmdMsg(m) + case m: GetWebcamsOnlyForModeratorReqMsg => usersApp.handleGetWebcamsOnlyForModeratorReqMsg(m) case m: UpdateWebcamsOnlyForModeratorCmdMsg => usersApp.handleUpdateWebcamsOnlyForModeratorCmdMsg(m) case m: GetRecordingStatusReqMsg => usersApp.handleGetRecordingStatusReqMsg(m) case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala index c34705254b67e712b876f8bbc38f0493251b91d5..9e259860f018446364e438c7d55beb547259d674 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala @@ -78,15 +78,13 @@ object GetRecordingStatusReqMsg { val NAME = "GetRecordingStatusReqMsg" } case class GetRecordingStatusReqMsg(header: BbbClientMsgHeader, body: GetRecordingStatusReqMsgBody) extends StandardMsg case class GetRecordingStatusReqMsgBody(requestedBy: String) - /** - * Sent by user as response to get recording mark. + * Sent to user as response to get recording mark. */ object GetRecordingStatusRespMsg { val NAME = "GetRecordingStatusRespMsg" } case class GetRecordingStatusRespMsg(header: BbbClientMsgHeader, body: GetRecordingStatusRespMsgBody) extends BbbCoreMsg case class GetRecordingStatusRespMsgBody(recording: Boolean, requestedBy: String) - /** * Sent by user to start recording mark. */ @@ -108,6 +106,20 @@ object UpdateWebcamsOnlyForModeratorCmdMsg { val NAME = "UpdateWebcamsOnlyForMod case class UpdateWebcamsOnlyForModeratorCmdMsg(header: BbbClientMsgHeader, body: UpdateWebcamsOnlyForModeratorCmdMsgBody) extends StandardMsg case class UpdateWebcamsOnlyForModeratorCmdMsgBody(webcamsOnlyForModerator: Boolean, setBy: String) +/** + * Sent by user to get the value of webcamsOnlyForModerator mark. + */ +object GetWebcamsOnlyForModeratorReqMsg { val NAME = "GetWebcamsOnlyForModeratorReqMsg" } +case class GetWebcamsOnlyForModeratorReqMsg(header: BbbClientMsgHeader, body: GetWebcamsOnlyForModeratorReqMsgBody) extends StandardMsg +case class GetWebcamsOnlyForModeratorReqMsgBody(requestedBy: String) + +/** + * Sent to user as response to get webcamsOnlyForModerator mark. + */ +object GetWebcamsOnlyForModeratorRespMsg { val NAME = "GetWebcamsOnlyForModeratorRespMsg" } +case class GetWebcamsOnlyForModeratorRespMsg(header: BbbClientMsgHeader, body: GetWebcamsOnlyForModeratorRespMsgBody) extends BbbCoreMsg +case class GetWebcamsOnlyForModeratorRespMsgBody(webcamsOnlyForModerator: Boolean, requestedBy: String) + /** * Sent to all users about webcam only for moderator value. */ diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as index 8f8e4ca4fb8fc3f81a2e593a13a4a2b72c4ca4ad..4c50724ac81d38d4ade48a45426676bb76f49625 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as @@ -76,6 +76,7 @@ package org.bigbluebutton.main.model.users } private function onAllowedToJoin():void { + sender.queryForWebcamsOnlyForModerator(); sender.queryForParticipants(); sender.queryForRecordingStatus(); sender.queryForGuestPolicy(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml index ba64b876a65d8679b9f30efb506559b43ec83581..f15cd04bba73c927d5b066bb96ecbcf6f787a698 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml @@ -57,8 +57,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. event.payload = lockSettings.toMap(); dispatchEvent(event); - var meetingWebcamsOnlyForModerator : Boolean = LiveMeeting.inst().meeting.webcamsOnlyForModerator; - if (meetingWebcamsOnlyForModerator != chkwebcamsOnlyForModerator.selected) { + if (LiveMeeting.inst().meeting.webcamsOnlyForModerator != chkwebcamsOnlyForModerator.selected) { var wEvent:SetWebcamsOnlyForModeratorEvent = new SetWebcamsOnlyForModeratorEvent(SetWebcamsOnlyForModeratorEvent.UPDATE_WEBCAMS_ONLY_FOR_MODERATOR); wEvent.webcamsOnlyForModerator = chkwebcamsOnlyForModerator.selected; dispatchEvent(wEvent); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index e0d6818110cee397bdae09d74808eb4eb6d047f0..2e4ed214a83ef3a0190677ebab28871e9cda9199 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -136,6 +136,9 @@ package org.bigbluebutton.modules.users.services case "GetRecordingStatusRespMsg": handleGetRecordingStatusReply(message); break; + case "GetWebcamsOnlyForModeratorRespMsg": + handleGetWebcamsOnlyForModeratorRespMsg(message); + break; case "RecordingStatusChangedEvtMsg": handleRecordingStatusChanged(message); break; @@ -609,6 +612,13 @@ package org.bigbluebutton.modules.users.services sendRecordingStatusUpdate(recording); } + + private function handleGetWebcamsOnlyForModeratorRespMsg(msg:Object):void { + var body:Object = msg.body as Object; + var webcamsOnlyForModerator: Boolean = body.webcamsOnlyForModerator as Boolean; + + LiveMeeting.inst().meeting.webcamsOnlyForModerator = webcamsOnlyForModerator; + } private function handleRecordingStatusChanged(msg: Object):void { var body:Object = msg.body as Object; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as index 8a5f93a9e109a88cd7fbc7ab7bd4accd5a64dc29..733ea80afa0e2462c57643cadc834725a8e01aaf 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as @@ -588,6 +588,28 @@ package org.bigbluebutton.modules.users.services JSON.stringify(message) ); } + + public function queryForWebcamsOnlyForModerator():void { + var message:Object = { + header: {name: "GetWebcamsOnlyForModeratorReqMsg", meetingId: UsersUtil.getInternalMeetingID(), + userId: UsersUtil.getMyUserID()}, + body: {requestedBy: UsersUtil.getMyUserID()} + }; + + var _nc:ConnectionManager = BBB.initConnectionManager(); + _nc.sendMessage2x( + function(result:String):void { // On successful result + LOGGER.debug(result); + }, + function(status:String):void { // status - On error occurred + var logData:Object = UsersUtil.initLogData(); + logData.tags = ["apps"]; + logData.message = "Error occured query webcamsOnlyForModerator."; + LOGGER.info(JSON.stringify(logData)); + }, + JSON.stringify(message) + ); + } public function queryForGuestPolicy():void { LOGGER.debug("queryForGuestPolicy");