- modify how we send lock and broadcast layout from client
This commit is contained in:
parent
4cfd877f37
commit
39fa4f2db1
@ -20,6 +20,8 @@ package org.bigbluebutton.conference.service.layout;
|
||||
|
||||
import org.bigbluebutton.core.api.IBigBlueButtonInGW;
|
||||
|
||||
import scala.Option;
|
||||
|
||||
public class LayoutApplication {
|
||||
private IBigBlueButtonInGW bbbInGW;
|
||||
|
||||
@ -27,16 +29,14 @@ public class LayoutApplication {
|
||||
bbbInGW = inGW;
|
||||
}
|
||||
|
||||
public void syncLayout(String meetingID, String requesterID, String layoutID) {
|
||||
bbbInGW.syncLayout(meetingID, requesterID, layoutID);
|
||||
}
|
||||
|
||||
public void broadcastLayout(String meetingID, String requesterID, String layoutID, Boolean locked) {
|
||||
bbbInGW.broadcastLayout(meetingID, requesterID, layoutID, locked);
|
||||
public void broadcastLayout(String meetingID, String requesterID, String layout) {
|
||||
bbbInGW.broadcastLayout(meetingID, requesterID, layout);
|
||||
}
|
||||
|
||||
public void unlockLayout(String meetingID, String requesterID) {
|
||||
bbbInGW.unlockLayout(meetingID, requesterID);
|
||||
public void lockLayout(String meetingId, String setById,
|
||||
Boolean lock, Boolean viewersOnly,
|
||||
Option<String> layout) {
|
||||
bbbInGW.lockLayout(meetingId, setById, lock, viewersOnly, layout);
|
||||
}
|
||||
|
||||
public void getCurrentLayout(String meetingID, String requesterID) {
|
||||
|
@ -25,6 +25,7 @@ import org.bigbluebutton.conference.Constants;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.Red5;
|
||||
import org.slf4j.Logger;
|
||||
import scala.Option;
|
||||
|
||||
public class LayoutService {
|
||||
|
||||
@ -37,20 +38,49 @@ public class LayoutService {
|
||||
log.debug("Received get current layout request");
|
||||
application.getCurrentLayout(meetingID, getBbbSession().getInternalUserID());
|
||||
}
|
||||
|
||||
public void sync(Map<String, Object> message) {
|
||||
String meetingID = Red5.getConnectionLocal().getScope().getName();
|
||||
application.syncLayout(meetingID, getBbbSession().getInternalUserID(), (String) message.get("layout"));
|
||||
}
|
||||
|
||||
|
||||
public void broadcast(Map<String, Object> message) {
|
||||
String meetingID = Red5.getConnectionLocal().getScope().getName();
|
||||
application.broadcastLayout(meetingID, (String) message.get("setByUserID"), (String) message.get("layout"), (Boolean) message.get("locked"));
|
||||
String newlayout = (String) message.get("layout");
|
||||
Boolean lock = (Boolean) message.get("lock");
|
||||
|
||||
if (newlayout == null || newlayout.isEmpty()) {
|
||||
log.error("Invalid Broadcast Layout message. layout is null or empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (lock == null) {
|
||||
log.error("Invalid Broadcast Layout message. lock in null.");
|
||||
return;
|
||||
}
|
||||
|
||||
application.broadcastLayout(meetingID, getBbbSession().getInternalUserID(), newlayout);
|
||||
}
|
||||
|
||||
public void unlock() {
|
||||
public void lock(Map<String, Object> message) {
|
||||
String meetingID = Red5.getConnectionLocal().getScope().getName();
|
||||
application.unlockLayout(meetingID, getBbbSession().getInternalUserID());
|
||||
String newlayout = (String) message.get("layout");
|
||||
Boolean lock = (Boolean) message.get("lock");
|
||||
Boolean viewersOnly = (Boolean) message.get("viewersOnly");
|
||||
|
||||
Option<String> layout;
|
||||
if (newlayout == null || newlayout.isEmpty()) {
|
||||
layout = Option.empty();
|
||||
} else {
|
||||
layout = scala.Option.apply(newlayout);
|
||||
}
|
||||
|
||||
if (lock == null) {
|
||||
log.error("Invalid Lock Layout message. lock in null.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (viewersOnly == null) {
|
||||
log.error("Invalid Lock Layout message. viewersOnly is null");
|
||||
return;
|
||||
}
|
||||
|
||||
application.lockLayout(meetingID, getBbbSession().getInternalUserID(), lock, viewersOnly, layout);
|
||||
}
|
||||
|
||||
public void setLayoutApplication(LayoutApplication a) {
|
||||
|
@ -3,6 +3,7 @@ package org.bigbluebutton.core.api;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface IBigBlueButtonInGW {
|
||||
|
||||
void isAliveAudit(String aliveID);
|
||||
@ -93,10 +94,10 @@ public interface IBigBlueButtonInGW {
|
||||
|
||||
// Layout
|
||||
void getCurrentLayout(String meetingID, String requesterID);
|
||||
void setLayout(String meetingID, String requesterID, String layoutID);
|
||||
void syncLayout(String meetingID, String requesterID, String layoutID);
|
||||
void broadcastLayout(String meetingID, String requesterID, String layoutID, Boolean locked);
|
||||
void unlockLayout(String meetingID, String requesterID);
|
||||
void broadcastLayout(String meetingID, String requesterID, String layout);
|
||||
void lockLayout(String meetingID, String setById,
|
||||
boolean lock, boolean viewersOnly,
|
||||
scala.Option<String> layout);
|
||||
|
||||
// Chat
|
||||
void getChatHistory(String meetingID, String requesterID, String replyTo);
|
||||
|
@ -98,8 +98,7 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
disablePubChat = disablePubChat,
|
||||
lockedLayout = lockedLayout)
|
||||
|
||||
val ls = new PermissionsSetting(permissions)
|
||||
bbbGW.accept(new SetLockSettings(meetingID, userId, ls))
|
||||
bbbGW.accept(new SetLockSettings(meetingID, userId, permissions))
|
||||
}
|
||||
|
||||
def initLockSettings(meetingID: String, locked: Boolean, settings: java.util.Map[String, java.lang.Boolean]) {
|
||||
@ -119,8 +118,7 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
disablePubChat = disablePubChat,
|
||||
lockedLayout = lockedLayout)
|
||||
|
||||
val ls = new PermissionsSetting(permissions)
|
||||
bbbGW.accept(new InitLockSettings(meetingID, locked, ls))
|
||||
bbbGW.accept(new InitLockSettings(meetingID, locked, permissions))
|
||||
}
|
||||
|
||||
def getLockSettings(meetingId: String, userId: String) {
|
||||
@ -341,20 +339,14 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
layoutGW.getCurrentLayout(meetingID, requesterID)
|
||||
}
|
||||
|
||||
def setLayout(meetingID: String, requesterID: String, layoutID: String) {
|
||||
layoutGW.setLayout(meetingID, requesterID, layoutID)
|
||||
}
|
||||
|
||||
def syncLayout(meetingID: String, requesterID: String, layoutID: String) {
|
||||
layoutGW.setLayout(meetingID, requesterID, layoutID)
|
||||
}
|
||||
|
||||
def broadcastLayout(meetingID: String, requesterID: String, layoutID: String, locked: java.lang.Boolean) {
|
||||
layoutGW.broadcastLayout(meetingID, requesterID, layoutID, locked)
|
||||
def broadcastLayout(meetingID: String, requesterID: String, layout: String) {
|
||||
layoutGW.broadcastLayout(meetingID, requesterID, layout)
|
||||
}
|
||||
|
||||
def unlockLayout(meetingID: String, requesterID: String) {
|
||||
layoutGW.unlockLayout(meetingID, requesterID)
|
||||
def lockLayout(meetingId: String, setById: String,
|
||||
lock: Boolean, viewersOnly: Boolean,
|
||||
layout: scala.Option[String]) {
|
||||
layoutGW.lockLayout(meetingId, setById, lock, viewersOnly, layout)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -51,9 +51,7 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
|
||||
case msg: SendPublicMessageRequest => handleSendPublicMessageRequest(msg)
|
||||
case msg: SendPrivateMessageRequest => handleSendPrivateMessageRequest(msg)
|
||||
case msg: GetCurrentLayoutRequest => handleGetCurrentLayoutRequest(msg)
|
||||
case msg: SetLayoutRequest => handleSetLayoutRequest(msg)
|
||||
case msg: BroadcastLayoutRequest => handleBroadcastLayoutRequest(msg)
|
||||
case msg: UnlockLayoutRequest => handleUnlockLayoutRequest(msg)
|
||||
case msg: PreCreatedPoll => handlePreCreatedPoll(msg)
|
||||
case msg: CreatePoll => handleCreatePoll(msg)
|
||||
case msg: UpdatePoll => handleUpdatePoll(msg)
|
||||
@ -631,44 +629,28 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
|
||||
dispatcher.dispatch(buildJson(header, payload))
|
||||
}
|
||||
|
||||
private def handleSetLayoutRequest(msg: SetLayoutRequest) {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.REQUESTER_ID, msg.requesterID)
|
||||
|
||||
val header = new java.util.HashMap[String, Any]()
|
||||
header.put(Constants.NAME, MessageNames.SET_LAYOUT)
|
||||
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
|
||||
|
||||
println("***** DISPATCHING SET LAYOUT REQUEST *****************")
|
||||
dispatcher.dispatch(buildJson(header, payload))
|
||||
}
|
||||
|
||||
private def handleBroadcastLayoutRequest(msg: BroadcastLayoutRequest) {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.REQUESTER_ID, msg.requesterID)
|
||||
payload.put(Constants.LAYOUT_ID, msg.layoutID)
|
||||
payload.put(Constants.LOCKED, msg.locked)
|
||||
|
||||
payload.put(Constants.LAYOUT, msg.layout)
|
||||
|
||||
val header = new java.util.HashMap[String, Any]()
|
||||
header.put(Constants.NAME, MessageNames.BROADCAST_LAYOUT)
|
||||
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
|
||||
|
||||
println("***** DISPATCHING BROADCAST LAYOUT REQUEST *****************")
|
||||
dispatcher.dispatch(buildJson(header, payload))
|
||||
}
|
||||
|
||||
private def handleUnlockLayoutRequest(msg: UnlockLayoutRequest) {
|
||||
private def handleLockLayoutRequest(msg: LockLayoutRequest) {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.REQUESTER_ID, msg.requesterID)
|
||||
payload.put(Constants.USER_ID, msg.setById)
|
||||
|
||||
val header = new java.util.HashMap[String, Any]()
|
||||
header.put(Constants.NAME, MessageNames.UNLOCK_LAYOUT)
|
||||
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
|
||||
|
||||
println("***** DISPATCHING UNLOCK LAYOUT REQUEST *****************")
|
||||
dispatcher.dispatch(buildJson(header, payload))
|
||||
}
|
||||
|
||||
@ -1390,7 +1372,7 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.LOCKED, msg.locked)
|
||||
payload.put(Constants.SETTINGS, msg.settings.toString()) //#todo not tested
|
||||
payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested
|
||||
|
||||
val header = new java.util.HashMap[String, Any]()
|
||||
header.put(Constants.NAME, MessageNames.PERMISSION_SETTING_INITIALIZED)
|
||||
@ -1403,7 +1385,7 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
|
||||
private def handleNewPermissionsSetting(msg: NewPermissionsSetting) {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.SETTINGS, msg.settings.toString()) //#todo not tested
|
||||
payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested
|
||||
|
||||
val header = new java.util.HashMap[String, Any]()
|
||||
header.put(Constants.NAME, MessageNames.NEW_PERMISSION_SETTINGS)
|
||||
|
@ -22,10 +22,11 @@ class MeetingActor(val meetingID: String, meetingName: String, val recorded: Boo
|
||||
with WhiteboardApp {
|
||||
|
||||
var permissionsInited = false
|
||||
var permissions = new PermissionsSetting(new Permissions())
|
||||
var permissions = new Permissions()
|
||||
var recording = false;
|
||||
var muted = false;
|
||||
var meetingEnded = false
|
||||
|
||||
|
||||
class TimerActor(val timeout: Long, val who: Actor, val reply: String) extends Actor {
|
||||
def act {
|
||||
@ -72,8 +73,6 @@ class MeetingActor(val meetingID: String, meetingName: String, val recorded: Boo
|
||||
case msg: UserConnectedToGlobalAudio => handleUserConnectedToGlobalAudio(msg)
|
||||
case msg: UserDisconnectedFromGlobalAudio => handleUserDisconnectedFromGlobalAudio(msg)
|
||||
case msg: GetCurrentLayoutRequest => handleGetCurrentLayoutRequest(msg)
|
||||
case msg: SetLayoutRequest => handleSetLayoutRequest(msg)
|
||||
case msg: LayoutLockSettings => handleLayoutLockSettings(msg)
|
||||
case msg: BroadcastLayoutRequest => handleBroadcastLayoutRequest(msg)
|
||||
case msg: InitializeMeeting => handleInitializeMeeting(msg)
|
||||
case msg: ClearPresentation => handleClearPresentation(msg)
|
||||
@ -165,5 +164,18 @@ class MeetingActor(val meetingID: String, meetingName: String, val recorded: Boo
|
||||
|
||||
private def handleGetRecordingStatus(msg: GetRecordingStatus) {
|
||||
outGW.send(new GetRecordingStatusReply(meetingID, recorded, msg.userId, recording.booleanValue()))
|
||||
}
|
||||
}
|
||||
|
||||
def lockLayout(lock: Boolean) {
|
||||
permissions = permissions.copy(lockedLayout=lock)
|
||||
}
|
||||
|
||||
def newPermissions(np: Permissions) {
|
||||
permissions = np
|
||||
}
|
||||
|
||||
def permissionsEqual(other: Permissions):Boolean = {
|
||||
permissions == other
|
||||
}
|
||||
|
||||
}
|
1
bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala
Executable file → Normal file
1
bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/Constants.scala
Executable file → Normal file
@ -29,6 +29,7 @@ object Constants {
|
||||
val ASSIGNED_BY = "assigned_by"
|
||||
val RECORDING = "recording"
|
||||
val LAYOUT_ID = "layout_id"
|
||||
val LAYOUT = "layout"
|
||||
val POLL = "poll"
|
||||
val POLL_ID = "poll_id"
|
||||
val FORCE = "force"
|
||||
|
@ -53,12 +53,12 @@ case class LockAllUsers(
|
||||
case class InitLockSettings(
|
||||
meetingID: String,
|
||||
locked: Boolean,
|
||||
settings: PermissionsSetting) extends InMessage
|
||||
settings: Permissions) extends InMessage
|
||||
|
||||
case class SetLockSettings(
|
||||
meetingID: String,
|
||||
setByUser: String,
|
||||
settings: PermissionsSetting
|
||||
settings: Permissions
|
||||
) extends InMessage
|
||||
|
||||
case class GetLockSettings(
|
||||
@ -195,24 +195,20 @@ case class SetLayoutRequest(
|
||||
layoutID: String
|
||||
) extends InMessage
|
||||
|
||||
case class LayoutLockSettings(
|
||||
meetingID: String,
|
||||
requesterId: String,
|
||||
locked: Boolean
|
||||
case class LockLayoutRequest(
|
||||
meetingID: String,
|
||||
setById: String,
|
||||
lock: Boolean,
|
||||
viewersOnly: Boolean,
|
||||
layout: Option[String]
|
||||
) extends InMessage
|
||||
|
||||
case class BroadcastLayoutRequest(
|
||||
meetingID: String,
|
||||
requesterID: String,
|
||||
layoutID: String,
|
||||
locked: Boolean
|
||||
layout: String
|
||||
) extends InMessage
|
||||
|
||||
case class UnlockLayoutRequest(
|
||||
meetingID: String,
|
||||
requesterID: String
|
||||
) extends InMessage
|
||||
|
||||
// Poll
|
||||
case class PreCreatedPoll(
|
||||
meetingID: String,
|
||||
|
@ -89,7 +89,7 @@ case object IsAliveMessage extends IOutMessage
|
||||
case class PermissionsSettingInitialized(
|
||||
meetingID: String,
|
||||
locked: Boolean,
|
||||
settings: PermissionsSetting,
|
||||
permissions: Permissions,
|
||||
applyTo: Array[UserVO],
|
||||
version:String = Versions.V_0_0_1
|
||||
) extends IOutMessage
|
||||
@ -97,7 +97,7 @@ case class PermissionsSettingInitialized(
|
||||
case class NewPermissionsSetting(
|
||||
meetingID: String,
|
||||
setByUser: String,
|
||||
settings: PermissionsSetting,
|
||||
permissions: Permissions,
|
||||
applyTo: Array[UserVO],
|
||||
version:String = Versions.V_0_0_1
|
||||
) extends IOutMessage
|
||||
|
@ -39,10 +39,6 @@ case class Permissions(
|
||||
lockedLayout:Boolean = false
|
||||
)
|
||||
|
||||
case class PermissionsSetting(
|
||||
permissions: Permissions
|
||||
)
|
||||
|
||||
case class RegisteredUser (
|
||||
id: String,
|
||||
externId: String,
|
||||
|
@ -9,51 +9,46 @@ trait LayoutApp {
|
||||
|
||||
val outGW: MessageOutGateway
|
||||
|
||||
private var _locked:Boolean = false;
|
||||
private var _setByUserID:String = "system";
|
||||
private var _currentLayoutID = "";
|
||||
|
||||
private var setByUser:String = "system";
|
||||
private var currentLayout = "";
|
||||
private var layoutLocked = false
|
||||
private var viewersOnly = false
|
||||
|
||||
def handleGetCurrentLayoutRequest(msg: GetCurrentLayoutRequest) {
|
||||
outGW.send(new GetCurrentLayoutReply(msg.meetingID, recorded, msg.requesterID, _currentLayoutID, _locked, _setByUserID))
|
||||
}
|
||||
|
||||
def handleSetLayoutRequest(msg: SetLayoutRequest) {
|
||||
_currentLayoutID = msg.layoutID
|
||||
outGW.send(new SetLayoutEvent(msg.meetingID, recorded, msg.requesterID, _currentLayoutID, _locked, _setByUserID, affectedUsers))
|
||||
}
|
||||
|
||||
def handleLayoutLockSettings(msg: LayoutLockSettings) {
|
||||
if (msg.locked) {
|
||||
_locked = true
|
||||
_setByUserID = msg.requesterId
|
||||
outGW.send(new LockLayoutEvent(msg.meetingID, recorded, msg.requesterId, _currentLayoutID, _locked, _setByUserID, affectedUsers))
|
||||
} else {
|
||||
_locked = false
|
||||
_setByUserID = msg.requesterId
|
||||
outGW.send(new UnlockLayoutEvent(msg.meetingID, recorded, msg.requesterId, _currentLayoutID, _locked, _setByUserID, affectedUsers))
|
||||
}
|
||||
outGW.send(new GetCurrentLayoutReply(msg.meetingID, recorded, msg.requesterID, currentLayout, permissions.lockedLayout, setByUser))
|
||||
}
|
||||
|
||||
def handleLockLayoutRequest(msg: LockLayoutRequest) {
|
||||
viewersOnly = msg.viewersOnly
|
||||
lockLayout(msg.lock)
|
||||
msg.layout foreach {l=>
|
||||
currentLayout = l
|
||||
broadcastSyncLayout(msg.meetingID, msg.setById)
|
||||
}
|
||||
}
|
||||
|
||||
private def broadcastSyncLayout(meetingId: String, setById: String) {
|
||||
outGW.send(new BroadcastLayoutEvent(meetingId, recorded, setById, currentLayout, permissions.lockedLayout, setByUser, affectedUsers))
|
||||
}
|
||||
|
||||
def handleBroadcastLayoutRequest(msg: BroadcastLayoutRequest) {
|
||||
_locked = msg.locked
|
||||
_currentLayoutID = msg.layoutID
|
||||
outGW.send(new BroadcastLayoutEvent(msg.meetingID, recorded, msg.requesterID, _currentLayoutID, _locked, _setByUserID, affectedUsers))
|
||||
currentLayout = msg.layout
|
||||
broadcastSyncLayout(msg.meetingID, msg.requesterID)
|
||||
}
|
||||
|
||||
def handleUnlockLayoutRequest(msg: UnlockLayoutRequest) {
|
||||
_locked = false
|
||||
_setByUserID = msg.requesterID
|
||||
outGW.send(new UnlockLayoutEvent(msg.meetingID, recorded, msg.requesterID, _currentLayoutID, _locked, _setByUserID, affectedUsers))
|
||||
}
|
||||
|
||||
|
||||
def affectedUsers():Array[UserVO] = {
|
||||
val au = ArrayBuffer[UserVO]()
|
||||
users.getUsers foreach {u =>
|
||||
if (! u.presenter && u.role != Role.MODERATOR) {
|
||||
au += u
|
||||
}
|
||||
if (viewersOnly) {
|
||||
val au = ArrayBuffer[UserVO]()
|
||||
users.getUsers foreach {u =>
|
||||
if (! u.presenter && u.role != Role.MODERATOR) {
|
||||
au += u
|
||||
}
|
||||
}
|
||||
au.toArray
|
||||
} else {
|
||||
users.getUsers
|
||||
}
|
||||
au.toArray
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
14
bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala
Executable file → Normal file
14
bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/layout/LayoutInGateway.scala
Executable file → Normal file
@ -9,15 +9,13 @@ class LayoutInGateway(bbbGW: BigBlueButtonGateway) {
|
||||
bbbGW.accept(new GetCurrentLayoutRequest(meetingID, requesterID))
|
||||
}
|
||||
|
||||
def setLayout(meetingID: String, requesterID: String, layoutID: String) {
|
||||
bbbGW.accept(new SetLayoutRequest(meetingID, requesterID, layoutID))
|
||||
def broadcastLayout(meetingID: String, requesterID: String, layout: String) {
|
||||
bbbGW.accept(new BroadcastLayoutRequest(meetingID, requesterID, layout))
|
||||
}
|
||||
|
||||
def broadcastLayout(meetingID: String, requesterID: String, layoutID: String, locked: Boolean) {
|
||||
bbbGW.accept(new BroadcastLayoutRequest(meetingID, requesterID, layoutID, locked))
|
||||
}
|
||||
|
||||
def unlockLayout(meetingID: String, requesterID: String) {
|
||||
bbbGW.accept(new UnlockLayoutRequest(meetingID, requesterID))
|
||||
def lockLayout(meetingID: String, setById: String,
|
||||
lock: Boolean, viewersOnly: Boolean,
|
||||
layout: Option[String]) {
|
||||
bbbGW.accept(new LockLayoutRequest(meetingID, setById, lock, viewersOnly, layout))
|
||||
}
|
||||
}
|
@ -44,8 +44,11 @@ class LayoutClientMessageSender(service: ConnectionInvokerService) extends OutMe
|
||||
message.put("setByUserID", msg.setByUserID);
|
||||
message.put("layout", msg.layoutID);
|
||||
|
||||
var m = new BroadcastClientMessage(msg.meetingID, "remoteUpdateLayout", message);
|
||||
service.sendMessage(m);
|
||||
msg.applyTo foreach {u =>
|
||||
var m = new DirectClientMessage(msg.meetingID, u.userID, "remoteUpdateLayout", message);
|
||||
service.sendMessage(m);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private def handleUnlockLayoutEvent(msg: UnlockLayoutEvent) {
|
||||
@ -54,7 +57,9 @@ class LayoutClientMessageSender(service: ConnectionInvokerService) extends OutMe
|
||||
message.put("setByUserID", msg.setByUserID);
|
||||
message.put("layout", msg.layoutID);
|
||||
|
||||
var m = new BroadcastClientMessage(msg.meetingID, "remoteUpdateLayout", message);
|
||||
service.sendMessage(m);
|
||||
msg.applyTo foreach {u =>
|
||||
var m = new DirectClientMessage(msg.meetingID, u.userID, "remoteUpdateLayout", message);
|
||||
service.sendMessage(m);
|
||||
};
|
||||
}
|
||||
}
|
@ -126,19 +126,13 @@ trait UsersApp {
|
||||
|
||||
def handleSetLockSettings(msg: SetLockSettings) {
|
||||
println("*************** Received new lock settings ********************")
|
||||
if (permissions != msg.settings) {
|
||||
permissions = msg.settings
|
||||
if (!permissionsEqual(msg.settings)) {
|
||||
newPermissions(msg.settings)
|
||||
val au = affectedUsers(msg.settings)
|
||||
outGW.send(new NewPermissionsSetting(meetingID, msg.setByUser, permissions, au))
|
||||
|
||||
changeLayout(msg)
|
||||
}
|
||||
}
|
||||
|
||||
private def changeLayout(msg: SetLockSettings) {
|
||||
this ! new LayoutLockSettings(msg.meetingID, msg.setByUser, permissions.permissions.lockedLayout)
|
||||
}
|
||||
|
||||
|
||||
def handleInitLockSettings(msg: InitLockSettings) {
|
||||
if (! permissionsInited) {
|
||||
permissionsInited = true
|
||||
@ -151,11 +145,11 @@ trait UsersApp {
|
||||
}
|
||||
}
|
||||
|
||||
def affectedUsers(settings: PermissionsSetting):Array[UserVO] = {
|
||||
def affectedUsers(settings: Permissions):Array[UserVO] = {
|
||||
val au = ArrayBuffer[UserVO]()
|
||||
|
||||
users.getUsers foreach {u =>
|
||||
val nu = u.copy(permissions=settings.permissions)
|
||||
val nu = u.copy(permissions=permissions)
|
||||
users.addUser(nu)
|
||||
if (! u.presenter && u.role != Role.MODERATOR) {
|
||||
au += nu
|
||||
@ -215,7 +209,7 @@ trait UsersApp {
|
||||
val uvo = new UserVO(msg.userID, ru.externId, ru.name,
|
||||
ru.role, raiseHand=false, presenter=false,
|
||||
hasStream=false, locked=false, webcamStream="",
|
||||
phoneUser=false, vu, listenOnly=false, permissions.permissions)
|
||||
phoneUser=false, vu, listenOnly=false, permissions)
|
||||
|
||||
users.addUser(uvo)
|
||||
|
||||
@ -260,7 +254,7 @@ trait UsersApp {
|
||||
val uvo = new UserVO(webUserId, webUserId, msg.voiceUser.callerName,
|
||||
Role.VIEWER, raiseHand=false, presenter=false,
|
||||
hasStream=false, locked=false, webcamStream="",
|
||||
phoneUser=true, vu, listenOnly=false, permissions.permissions)
|
||||
phoneUser=true, vu, listenOnly=false, permissions)
|
||||
|
||||
users.addUser(uvo)
|
||||
println("New user joined voice for user [" + uvo.name + "] userid=[" + msg.voiceUser.webUserId + "]")
|
||||
|
@ -84,11 +84,11 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
|
||||
|
||||
private def handleNewPermissionsSetting(msg: NewPermissionsSetting) {
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
args.put("disableCam", msg.settings.permissions.disableCam:java.lang.Boolean);
|
||||
args.put("disableMic", msg.settings.permissions.disableMic:java.lang.Boolean);
|
||||
args.put("disablePrivChat", msg.settings.permissions.disablePrivChat:java.lang.Boolean);
|
||||
args.put("disablePubChat", msg.settings.permissions.disablePubChat:java.lang.Boolean);
|
||||
args.put("lockedLayout", msg.settings.permissions.lockedLayout:java.lang.Boolean);
|
||||
args.put("disableCam", msg.permissions.disableCam:java.lang.Boolean);
|
||||
args.put("disableMic", msg.permissions.disableMic:java.lang.Boolean);
|
||||
args.put("disablePrivChat", msg.permissions.disablePrivChat:java.lang.Boolean);
|
||||
args.put("disablePubChat", msg.permissions.disablePubChat:java.lang.Boolean);
|
||||
args.put("lockedLayout", msg.permissions.lockedLayout:java.lang.Boolean);
|
||||
|
||||
var users = new ArrayList[java.util.HashMap[String, Object]];
|
||||
msg.applyTo.foreach(uvo => {
|
||||
|
@ -80,7 +80,7 @@ object UsersMessageToJsonConverter {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put(Constants.LOCKED, msg.locked)
|
||||
payload.put(Constants.SETTINGS, msg.settings.toString()) //#todo not tested
|
||||
payload.put(Constants.SETTINGS, msg.permissions.toString()) //#todo not tested
|
||||
|
||||
val header = Util.buildHeader(MessageNames.PERMISSION_SETTING_INITIALIZED, msg.version, None)
|
||||
Util.buildJson(header, payload)
|
||||
@ -89,10 +89,10 @@ object UsersMessageToJsonConverter {
|
||||
def newPermissionsSettingToJson(msg: NewPermissionsSetting):String = {
|
||||
val payload = new java.util.HashMap[String, Any]()
|
||||
payload.put(Constants.MEETING_ID, msg.meetingID)
|
||||
payload.put("disableCam", msg.settings.permissions.disableCam)
|
||||
payload.put("disableMic", msg.settings.permissions.disableMic)
|
||||
payload.put("disablePrivChat", msg.settings.permissions.disablePrivChat)
|
||||
payload.put("disablePubChat", msg.settings.permissions.disablePubChat)
|
||||
payload.put("disableCam", msg.permissions.disableCam)
|
||||
payload.put("disableMic", msg.permissions.disableMic)
|
||||
payload.put("disablePrivChat", msg.permissions.disablePrivChat)
|
||||
payload.put("disablePubChat", msg.permissions.disablePubChat)
|
||||
|
||||
val users = new java.util.ArrayList[java.util.Map[String, Any]]
|
||||
msg.applyTo.foreach(uvo => {
|
||||
|
@ -58,14 +58,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Point;
|
||||
|
||||
import flash.geom.Point;
|
||||
import flexlib.mdi.containers.MDIWindow;
|
||||
import flexlib.mdi.effects.effectsLib.MDIVistaEffects;
|
||||
|
||||
import flexlib.mdi.effects.effectsLib.MDIVistaEffects;
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.containers.TitleWindow;
|
||||
import mx.controls.Alert;
|
||||
@ -73,8 +70,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import mx.core.IFlexDisplayObject;
|
||||
import mx.core.UIComponent;
|
||||
import mx.events.CloseEvent;
|
||||
import mx.managers.PopUpManager;
|
||||
|
||||
import mx.managers.PopUpManager;
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
@ -166,9 +162,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
showFooterOpt = layoutOptions.showFooter;
|
||||
if (!showFooterOpt) {
|
||||
footerHeight = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected function initializeShell():void {
|
||||
@ -319,9 +313,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
}
|
||||
|
||||
private function handleFlashMicSettingsEvent(event:FlashMicSettingsEvent):void {
|
||||
// showEarbudsHeadsetRequired();
|
||||
|
||||
private function handleFlashMicSettingsEvent(event:FlashMicSettingsEvent):void {
|
||||
var micSettings:FlashMicSettings = PopUpManager.createPopUp(mdiCanvas, FlashMicSettings, true) as FlashMicSettings;
|
||||
micSettings.addEventListener(FlexEvent.CREATION_COMPLETE, function(e:Event):void {
|
||||
var point1:Point = new Point();
|
||||
@ -428,8 +420,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
private function handleAskMicPermissionEvent(event:WebRtcAskMicPermissionEvent):void {
|
||||
// showEarbudsHeadsetRequired();
|
||||
|
||||
var browser:String = event.browser;
|
||||
if (browser == "Firefox") {
|
||||
var ffBrowser:FirefoxMicPermissionImage = PopUpManager.createPopUp(mdiCanvas, FirefoxMicPermissionImage, true) as FirefoxMicPermissionImage;
|
||||
|
@ -30,15 +30,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import flash.events.Event;
|
||||
|
||||
import flash.events.Event;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.core.managers.UserManager;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
import org.bigbluebutton.modules.layout.events.LayoutEvent;
|
||||
|
||||
import org.bigbluebutton.modules.layout.events.LayoutEvent;
|
||||
import org.bigbluebutton.main.events.BBBEvent;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
import flash.events.FocusEvent;
|
||||
|
@ -35,8 +35,7 @@
|
||||
<mate:Listener type="{ShortcutEvent.MUTE_ALL_BUT_PRES}" method="remoteMuteAllButPres" />
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
import mx.binding.utils.BindingUtils;
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.controls.Menu;
|
||||
@ -44,8 +43,7 @@
|
||||
import mx.core.IFlexDisplayObject;
|
||||
import mx.events.ListEvent;
|
||||
import mx.events.MenuEvent;
|
||||
import mx.managers.PopUpManager;
|
||||
|
||||
import mx.managers.PopUpManager;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.common.Role;
|
||||
|
Loading…
Reference in New Issue
Block a user