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 fa811677d0..d04aca3578 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 @@ -214,9 +214,9 @@ class ReceivedJsonMsgHandlerActor( } yield { send(m.header.meetingId, envelope, m) } - case GetCurrentLayoutMsg.NAME => + case GetCurrentLayoutReqMsg.NAME => for { - m <- deserialize[GetCurrentLayoutMsg](jsonNode) + m <- deserialize[GetCurrentLayoutReqMsg](jsonNode) } yield { send(m.header.meetingId, envelope, m) } 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 2492fe5e3a..2a7c60e23c 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 @@ -73,7 +73,7 @@ class MeetingActor(val props: DefaultProps, with TransferUserToMeetingRequestHdlr with UserMutedInVoiceConfEvtMsgHdlr with UserTalkingInVoiceConfEvtMsgHdlr - with GetCurrentLayoutMsgHdlr + with GetCurrentLayoutReqMsgHdlr with LockLayoutMsgHdlr with BroadcastLayoutMsgHdlr { @@ -233,7 +233,7 @@ class MeetingActor(val props: DefaultProps, case m: UserLeftVoiceConfEvtMsg => handle(m) case m: UserMutedInVoiceConfEvtMsg => handle(m) case m: UserTalkingInVoiceConfEvtMsg => handle(m) - case m: GetCurrentLayoutMsg => handleGetCurrentLayoutMsg(m) + case m: GetCurrentLayoutReqMsg => handleGetCurrentLayoutReqMsg(m) case m: LockLayoutMsg => handleLockLayoutMsg(m) case m: BroadcastLayoutMsg => handleBroadcastLayoutMsg(m) case m: SetCurrentPresentationPubMsg => presentationApp2x.handleSetCurrentPresentationPubMsg(m) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/BroadcastLayoutMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/BroadcastLayoutMsgHdlr.scala index 51eef4df2b..d8e55184dc 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/BroadcastLayoutMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/BroadcastLayoutMsgHdlr.scala @@ -19,7 +19,7 @@ trait BroadcastLayoutMsgHdlr { val envelope = BbbCoreEnvelope(BroadcastLayoutEvtMsg.NAME, routing) val header = BbbClientMsgHeader(BroadcastLayoutEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) - val body = BroadcastLayoutEvtMsgBody(msg.body.meetingId, props.recordProp.record, msg.body.requesterId, + val body = BroadcastLayoutEvtMsgBody( Layouts.getCurrentLayout(), MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout, Layouts.getLayoutSetter(), affectedUsers) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutMsgHdlr.scala deleted file mode 100755 index 119e378edf..0000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutMsgHdlr.scala +++ /dev/null @@ -1,34 +0,0 @@ -package org.bigbluebutton.core2.message.handlers.layout - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.running.MeetingActor -import org.bigbluebutton.core2.MeetingStatus2x -import org.bigbluebutton.core.OutMessageGateway -import org.bigbluebutton.core.models.Layouts - -trait GetCurrentLayoutMsgHdlr { - this: MeetingActor => - - val outGW: OutMessageGateway - - def handleGetCurrentLayoutMsg(msg: GetCurrentLayoutMsg): Unit = { - - def broadcastEvent(msg: GetCurrentLayoutMsg): Unit = { - - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(GetCurrentLayoutEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(GetCurrentLayoutEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) - - val body = GetCurrentLayoutEvtMsgBody(msg.body.meetingId, props.recordProp.record, msg.body.requesterId, - Layouts.getCurrentLayout(), - MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout, - Layouts.getLayoutSetter()) - val event = GetCurrentLayoutEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - - outGW.send(msgEvent) - } - - broadcastEvent(msg) - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutReqMsgHdlr.scala new file mode 100755 index 0000000000..154d15af2e --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/GetCurrentLayoutReqMsgHdlr.scala @@ -0,0 +1,33 @@ +package org.bigbluebutton.core2.message.handlers.layout + +import org.bigbluebutton.common2.msgs._ +import org.bigbluebutton.core.running.MeetingActor +import org.bigbluebutton.core2.MeetingStatus2x +import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.models.Layouts + +trait GetCurrentLayoutReqMsgHdlr { + this: MeetingActor => + + val outGW: OutMessageGateway + + def handleGetCurrentLayoutReqMsg(msg: GetCurrentLayoutReqMsg): Unit = { + + def broadcastEvent(msg: GetCurrentLayoutReqMsg): Unit = { + + val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, props.meetingProp.intId, msg.header.userId) + val envelope = BbbCoreEnvelope(GetCurrentLayoutRespMsg.NAME, routing) + val header = BbbClientMsgHeader(GetCurrentLayoutRespMsg.NAME, props.meetingProp.intId, msg.header.userId) + + val body = GetCurrentLayoutRespMsgBody(Layouts.getCurrentLayout(), + MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout, + Layouts.getLayoutSetter()) + val event = GetCurrentLayoutRespMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, event) + + outGW.send(msgEvent) + } + + broadcastEvent(msg) + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/LockLayoutMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/LockLayoutMsgHdlr.scala index 6d7777300c..993778d1fd 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/LockLayoutMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/layout/LockLayoutMsgHdlr.scala @@ -22,7 +22,7 @@ trait LockLayoutMsgHdlr { val envelope = BbbCoreEnvelope(LockLayoutEvtMsg.NAME, routing) val header = BbbClientMsgHeader(LockLayoutEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) - val body = LockLayoutEvtMsgBody(msg.body.meetingId, props.recordProp.record, msg.body.setById, msg.body.lock, affectedUsers) + val body = LockLayoutEvtMsgBody(msg.header.userId, msg.body.lock, affectedUsers) val event = LockLayoutEvtMsg(header, body) val msgEvent = BbbCommonEnvCoreMsg(envelope, event) @@ -30,19 +30,17 @@ trait LockLayoutMsgHdlr { msg.body.layout foreach { l => Layouts.setCurrentLayout(l) - broadcastSyncLayout(msg.body.meetingId, msg.body.setById) + broadcastSyncLayout() } - - outGW.send(msgEvent) } - def broadcastSyncLayout(meetingId: String, setById: String) { + def broadcastSyncLayout() { val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, props.meetingProp.intId, msg.header.userId) val envelope = BbbCoreEnvelope(BroadcastLayoutEvtMsg.NAME, routing) val header = BbbClientMsgHeader(BroadcastLayoutEvtMsg.NAME, props.meetingProp.intId, msg.header.userId) - val body = BroadcastLayoutEvtMsgBody(meetingId, props.recordProp.record, setById, + val body = BroadcastLayoutEvtMsgBody( Layouts.getCurrentLayout(), MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout, Layouts.getLayoutSetter(), affectedUsers) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/LayoutMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/LayoutMsgs.scala index ce1ffc8ed1..529bfa44d8 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/LayoutMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/LayoutMsgs.scala @@ -5,32 +5,28 @@ import org.bigbluebutton.common2.domain.UserVO // In messages - object GetCurrentLayoutMsg { val NAME = "GetCurrentLayoutMsg" } - case class GetCurrentLayoutMsg(header: BbbClientMsgHeader, body: GetCurrentLayoutMsgBody) extends BbbCoreMsg - case class GetCurrentLayoutMsgBody(meetingId: String, requesterId: String) + object GetCurrentLayoutReqMsg { val NAME = "GetCurrentLayoutReqMsg" } + case class GetCurrentLayoutReqMsg(header: BbbClientMsgHeader, body: GetCurrentLayoutReqMsgBody) extends BbbCoreMsg + case class GetCurrentLayoutReqMsgBody() object LockLayoutMsg { val NAME = "LockLayoutMsg" } case class LockLayoutMsg(header: BbbClientMsgHeader, body: LockLayoutMsgBody) extends BbbCoreMsg - case class LockLayoutMsgBody(meetingId: String, setById: String, lock: Boolean, viewersOnly: Boolean, - layout: Option[String]) + case class LockLayoutMsgBody(lock: Boolean, viewersOnly: Boolean, layout: Option[String]) object BroadcastLayoutMsg { val NAME = "BroadcastLayoutMsg" } case class BroadcastLayoutMsg(header: BbbClientMsgHeader, body: BroadcastLayoutMsgBody) extends BbbCoreMsg - case class BroadcastLayoutMsgBody(meetingId: String, requesterId: String, layout: String) + case class BroadcastLayoutMsgBody(layout: String) // Out messages - object GetCurrentLayoutEvtMsg { val NAME = "GetCurrentLayoutEvtMsg" } - case class GetCurrentLayoutEvtMsg(header: BbbClientMsgHeader, body: GetCurrentLayoutEvtMsgBody) extends BbbCoreMsg - case class GetCurrentLayoutEvtMsgBody(meetingId: String, recorded: Boolean, requesterId: String, layoutId: String, - locked: Boolean, setByUserId: String) + object GetCurrentLayoutRespMsg { val NAME = "GetCurrentLayoutRespMsg" } + case class GetCurrentLayoutRespMsg(header: BbbClientMsgHeader, body: GetCurrentLayoutRespMsgBody) extends BbbCoreMsg + case class GetCurrentLayoutRespMsgBody(layoutId: String, locked: Boolean, setByUserId: String) object BroadcastLayoutEvtMsg { val NAME = "BroadcastLayoutEvtMsg" } case class BroadcastLayoutEvtMsg(header: BbbClientMsgHeader, body: BroadcastLayoutEvtMsgBody) extends BbbCoreMsg - case class BroadcastLayoutEvtMsgBody(meetingId: String, recorded: Boolean, requesterId: String, - layoutId: String, locked: Boolean, setByUserId: String, applyTo: Array[UserVO]) + case class BroadcastLayoutEvtMsgBody(layoutId: String, locked: Boolean, setByUserId: String, applyTo: Array[UserVO]) object LockLayoutEvtMsg { val NAME = "LockLayoutEvtMsg" } case class LockLayoutEvtMsg(header: BbbClientMsgHeader, body: LockLayoutEvtMsgBody) extends BbbCoreMsg - case class LockLayoutEvtMsgBody(meetingId: String, recorded: Boolean, setById: String, locked: Boolean, - applyTo: Array[UserVO]) + case class LockLayoutEvtMsgBody(setById: String, locked: Boolean, applyTo: Array[UserVO]) diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/BroadcastLayoutMsgBody.as b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/BroadcastLayoutMsgBody.as old mode 100644 new mode 100755 index b5c6639273..91621aa7ec --- a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/BroadcastLayoutMsgBody.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/BroadcastLayoutMsgBody.as @@ -20,15 +20,9 @@ package org.bigbluebutton.core.connection.messages.layout { public class BroadcastLayoutMsgBody { - public var meetingId:String; - - public var requesterId:String; - public var layout:String; - public function BroadcastLayoutMsgBody(meetingId:String, requesterId:String, layout:String) { - this.meetingId = meetingId; - this.requesterId = requesterId; + public function BroadcastLayoutMsgBody(layout:String) { this.layout = layout; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsg.as b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsg.as old mode 100644 new mode 100755 similarity index 82% rename from bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsg.as rename to bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsg.as index 92f97bc667..050c638ebe --- a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsg.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsg.as @@ -19,10 +19,10 @@ package org.bigbluebutton.core.connection.messages.layout { import org.bigbluebutton.core.connection.messages.BbbCommonMsg; - public class GetCurrentLayoutMsg extends BbbCommonMsg { - public var body:GetCurrentLayoutMsgBody; + public class GetCurrentLayoutReqMsg extends BbbCommonMsg { + public var body:GetCurrentLayoutReqMsgBody; - public function GetCurrentLayoutMsg(body:GetCurrentLayoutMsgBody) { + public function GetCurrentLayoutReqMsg(body:GetCurrentLayoutReqMsgBody) { super(); this.body = body; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsgBody.as b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsgBody.as old mode 100644 new mode 100755 similarity index 76% rename from bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsgBody.as rename to bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsgBody.as index 62f29088cd..40ff04c0bc --- a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutMsgBody.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/GetCurrentLayoutReqMsgBody.as @@ -18,15 +18,9 @@ */ package org.bigbluebutton.core.connection.messages.layout { - public class GetCurrentLayoutMsgBody { + public class GetCurrentLayoutReqMsgBody { - public var meetingId:String; - - public var requesterId:String; - - public function GetCurrentLayoutMsgBody(meetingId:String, requesterId:String) { - this.meetingId = meetingId; - this.requesterId = requesterId; + public function GetCurrentLayoutReqMsgBody() { } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/LockLayoutMsgBody.as b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/LockLayoutMsgBody.as old mode 100644 new mode 100755 index 6f1eb6c4aa..cad0cc41a5 --- a/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/LockLayoutMsgBody.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/connection/messages/layout/LockLayoutMsgBody.as @@ -20,19 +20,13 @@ package org.bigbluebutton.core.connection.messages.layout { public class LockLayoutMsgBody { - public var meetingId:String; - - public var setById:String; - public var lock:Boolean; public var viewersOnly:Boolean; public var layout:String; - public function LockLayoutMsgBody(meetingId:String, setById:String, lock:Boolean, viewersOnly:Boolean, layout:String) { - this.meetingId = meetingId; - this.setById = setById; + public function LockLayoutMsgBody(lock:Boolean, viewersOnly:Boolean, layout:String) { this.lock = lock; this.viewersOnly = viewersOnly; this.layout = layout; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as index 4463adccfc..6650ff565d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageReceiver.as @@ -31,8 +31,8 @@ package org.bigbluebutton.modules.layout.services { // trace("LAYOUT: received message " + messageName); switch (messageName) { - case "GetCurrentLayoutEvtMsg": - handleGetCurrentLayoutEvtMsg(message); + case "GetCurrentLayoutRespMsg": + handleGetCurrentLayoutRespMsg(message); break; case "BroadcastLayoutEvtMsg": handleBroadcastLayoutEvtMsg(message); @@ -50,7 +50,7 @@ package org.bigbluebutton.modules.layout.services { } } - private function handleGetCurrentLayoutEvtMsg(message:Object):void { + private function handleGetCurrentLayoutRespMsg(message:Object):void { _applyFirstLayoutTimer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void { onReceivedFirstLayout(message.body); }); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageSender.as old mode 100644 new mode 100755 index e474cf3bd8..1f3dd9d9f5 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/services/MessageSender.as @@ -5,8 +5,8 @@ package org.bigbluebutton.modules.layout.services { import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.connection.messages.layout.BroadcastLayoutMsg; import org.bigbluebutton.core.connection.messages.layout.BroadcastLayoutMsgBody; - import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutMsg; - import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutMsgBody; + import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutReqMsg; + import org.bigbluebutton.core.connection.messages.layout.GetCurrentLayoutReqMsgBody; import org.bigbluebutton.core.connection.messages.layout.LockLayoutMsg; import org.bigbluebutton.core.connection.messages.layout.LockLayoutMsgBody; import org.bigbluebutton.core.managers.ConnectionManager; @@ -16,8 +16,8 @@ package org.bigbluebutton.modules.layout.services { private static const LOGGER:ILogger = getClassLogger(MessageSender); public function getCurrentLayout():void { - var body:GetCurrentLayoutMsgBody = new GetCurrentLayoutMsgBody(UsersUtil.getInternalMeetingID(), UsersUtil.getMyUserID()); - var message:GetCurrentLayoutMsg = new GetCurrentLayoutMsg(body); + var body:GetCurrentLayoutReqMsgBody = new GetCurrentLayoutReqMsgBody(); + var message:GetCurrentLayoutReqMsg = new GetCurrentLayoutReqMsg(body); var _nc:ConnectionManager = BBB.initConnectionManager(); _nc.sendMessage2x(function(result:String):void { // On successful result @@ -30,7 +30,7 @@ package org.bigbluebutton.modules.layout.services { } public function broadcastLayout(layout:LayoutDefinition):void { - var body:BroadcastLayoutMsgBody = new BroadcastLayoutMsgBody(UsersUtil.getInternalMeetingID(), UsersUtil.getMyUserID(), layout.toXml().toXMLString()); + var body:BroadcastLayoutMsgBody = new BroadcastLayoutMsgBody(layout.toXml().toXMLString()); var message:BroadcastLayoutMsg = new BroadcastLayoutMsg(body); var _nc:ConnectionManager = BBB.initConnectionManager(); @@ -44,7 +44,7 @@ package org.bigbluebutton.modules.layout.services { } public function lockLayout(lock:Boolean, viewersOnly:Boolean, layout:LayoutDefinition = null):void { - var body:LockLayoutMsgBody = new LockLayoutMsgBody(UsersUtil.getInternalMeetingID(), UsersUtil.getMyUserID(), lock, viewersOnly, layout != null ? layout.toXml().toXMLString() : null); + var body:LockLayoutMsgBody = new LockLayoutMsgBody(lock, viewersOnly, layout != null ? layout.toXml().toXMLString() : null); var message:LockLayoutMsg = new LockLayoutMsg(body); var _nc:ConnectionManager = BBB.initConnectionManager();