Request webcamsOnlyForModerator value at user enter success.

This commit is contained in:
Ghazi Triki 2018-01-07 22:24:54 +01:00
parent 8129f67879
commit 36f02e8528
9 changed files with 82 additions and 5 deletions

View File

@ -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)
}
}

View File

@ -21,6 +21,7 @@ class UsersApp(
with SetRecordingStatusCmdMsgHdlr
with UpdateWebcamsOnlyForModeratorCmdMsgHdlr
with GetRecordingStatusReqMsgHdlr
with GetWebcamsOnlyForModeratorReqMsgHdlr
with AssignPresenterReqMsgHdlr
with EjectUserFromMeetingCmdMsgHdlr {

View File

@ -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)

View File

@ -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)

View File

@ -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.
*/

View File

@ -76,6 +76,7 @@ package org.bigbluebutton.main.model.users
}
private function onAllowedToJoin():void {
sender.queryForWebcamsOnlyForModerator();
sender.queryForParticipants();
sender.queryForRecordingStatus();
sender.queryForGuestPolicy();

View File

@ -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);

View File

@ -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;

View File

@ -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");