Merge branch 'master' of github.com:bigbluebutton/bigbluebutton into implement-multi-chat

This commit is contained in:
Richard Alam 2017-10-29 09:13:07 -07:00
commit 976b8cb687
15 changed files with 132 additions and 8 deletions

View File

@ -0,0 +1,37 @@
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.models.Users2x
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
trait GetPresenterGroupReqMsgHdlr {
this: UsersApp =>
val liveMeeting: LiveMeeting
val outGW: OutMsgRouter
def handleGetPresenterGroupReqMsg(msg: GetPresenterGroupReqMsg) {
def broadcastGetPresenterGroupRespMsg(meetingId: String, userId: String, requesterId: String, presenterGroup: Vector[String]): Unit = {
val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, requesterId)
val envelope = BbbCoreEnvelope(GetPresenterGroupRespMsg.NAME, routing)
val header = BbbClientMsgHeader(GetPresenterGroupRespMsg.NAME, meetingId, userId)
val body = GetPresenterGroupRespMsgBody(presenterGroup, requesterId)
val event = GetPresenterGroupRespMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}
val userId = msg.header.userId
val requesterId = msg.body.requesterId
for {
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId)
} yield {
val presGroup = Users2x.getPresenterGroupUsers(liveMeeting.users2x)
broadcastGetPresenterGroupRespMsg(liveMeeting.props.meetingProp.intId, userId, requesterId, presGroup)
}
}
}

View File

@ -23,6 +23,7 @@ class UsersApp(
with AssignPresenterReqMsgHdlr
with AddUserToPresenterGroupCmdMsgHdlr
with RemoveUserFromPresenterGroupCmdMsgHdlr
with GetPresenterGroupReqMsgHdlr
with EjectUserFromMeetingCmdMsgHdlr
with MuteUserCmdMsgHdlr
with MuteUserCmdMsgHdlrPermCheck {

View File

@ -86,6 +86,8 @@ class ReceivedJsonMsgHandlerActor(
routeGenericMsg[AddUserToPresenterGroupCmdMsg](envelope, jsonNode)
case RemoveUserFromPresenterGroupCmdMsg.NAME =>
routeGenericMsg[RemoveUserFromPresenterGroupCmdMsg](envelope, jsonNode)
case GetPresenterGroupReqMsg.NAME =>
routeGenericMsg[GetPresenterGroupReqMsg](envelope, jsonNode)
// Poll
case StartCustomPollReqMsg.NAME =>

View File

@ -227,6 +227,7 @@ class MeetingActor(
case m: AddUserToPresenterGroupCmdMsg => usersApp.handleAddUserToPresenterGroupCmdMsg(m)
case m: RemoveUserFromPresenterGroupCmdMsg =>
usersApp.handleRemoveUserFromPresenterGroupCmdMsg(m)
case m: GetPresenterGroupReqMsg => usersApp.handleGetPresenterGroupReqMsg(m)
// Whiteboard
case m: SendCursorPositionPubMsg => wbApp.handle(m, liveMeeting, msgBus)

View File

@ -310,3 +310,17 @@ case class RemoveUserFromPresenterGroupCmdMsgBody(userId: String, requesterId: S
object UserRemovedFromPresenterGroupEvtMsg { val NAME = "UserRemovedFromPresenterGroupEvtMsg" }
case class UserRemovedFromPresenterGroupEvtMsg(header: BbbClientMsgHeader, body: UserRemovedFromPresenterGroupEvtMsgBody) extends StandardMsg
case class UserRemovedFromPresenterGroupEvtMsgBody(userId: String, requesterId: String)
/**
* Sent from client to request the presenter group of a meeting.
*/
object GetPresenterGroupReqMsg { val NAME = "GetPresenterGroupReqMsg" }
case class GetPresenterGroupReqMsg(header: BbbClientMsgHeader, body: GetPresenterGroupReqMsgBody) extends StandardMsg
case class GetPresenterGroupReqMsgBody(requesterId: String)
/**
* Sent to all clients about the members of the presenter group of a meeting
*/
object GetPresenterGroupRespMsg { val NAME = "GetPresenterGroupRespMsg" }
case class GetPresenterGroupRespMsg(header: BbbClientMsgHeader, body: GetPresenterGroupRespMsgBody) extends StandardMsg
case class GetPresenterGroupRespMsgBody(presenterGroup: Vector[String], requesterId: String)

View File

@ -51,6 +51,8 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.main.model.users.events.UsersConnectionEvent;
import org.bigbluebutton.main.model.users.events.AddUserToPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.RemoveUserFromPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
import org.bigbluebutton.modules.users.services.MessageReceiver;
import org.bigbluebutton.modules.users.services.MessageSender;
@ -272,6 +274,10 @@ package org.bigbluebutton.main.model.users
if (this.isModerator()) sender.removeUserFromPresenterGroup(e.userId);
}
public function handleRequestPresenterGroupEvent(e: RequestPresenterGroupEvent): void {
sender.handleRequestPresenterGroupEvent();
}
public function changeRole(e:ChangeRoleEvent):void {
if (this.isModerator()) sender.changeRole(e.userid, e.role);
}

View File

@ -0,0 +1,32 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.users.events
{
import flash.events.Event;
public class RequestPresenterGroupEvent extends Event {
public static const REQUEST_PRESENTER_GROUP:String = "REQUEST_PRESENTER_GROUP";
public function RequestPresenterGroupEvent(type:String) {
super(type, true, false);
}
}
}

View File

@ -32,6 +32,7 @@ package org.bigbluebutton.modules.present.managers
import org.bigbluebutton.common.events.CloseWindowEvent;
import org.bigbluebutton.core.Options;
import org.bigbluebutton.core.PopUpUtil;
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
import org.bigbluebutton.modules.present.events.ExportEvent;
import org.bigbluebutton.modules.present.events.PresentModuleEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
@ -62,8 +63,11 @@ package org.bigbluebutton.modules.present.managers
return;
}
var event:RequestAllPodsEvent = new RequestAllPodsEvent(RequestAllPodsEvent.REQUEST_ALL_PODS);
globalDispatcher.dispatchEvent(event);
var requestAllPodsEvent:RequestAllPodsEvent = new RequestAllPodsEvent(RequestAllPodsEvent.REQUEST_ALL_PODS);
globalDispatcher.dispatchEvent(requestAllPodsEvent);
var requestPresenterGroupEvent:RequestPresenterGroupEvent = new RequestPresenterGroupEvent(RequestPresenterGroupEvent.REQUEST_PRESENTER_GROUP);
globalDispatcher.dispatchEvent(requestPresenterGroupEvent);
}
public function handleAddPresentationPod(e: NewPresentationPodCreated): void {

View File

@ -49,7 +49,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent;
import org.bigbluebutton.modules.present.events.RequestAllPodsEvent;
import org.bigbluebutton.modules.present.events.SetPresenterInPodReqEvent;
// import org.bigbluebutton.modules.present.events.SetPresenterInPodRespEvent;
import org.bigbluebutton.modules.present.managers.PresentManager;
import org.bigbluebutton.modules.present.model.PresentationPodManager;
import org.bigbluebutton.modules.present.services.PageLoaderService;
@ -193,8 +192,5 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{PresentProxy}" method="handleSetPresenterInPodReqEvent" arguments="{event}" />
</EventHandlers>
<!--<EventHandlers type="{SetPresenterInPodRespEvent.SET_PRESENTER_IN_POD_RESP}" >-->
<!--<MethodInvoker generator="{PresentManager}" method="handleSetPresenterInPodRespEvent" arguments="{event}" />-->
<!--</EventHandlers>-->
</fx:Declarations>
</EventMap>

View File

@ -119,7 +119,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function setPodId(_podId: String): void {
podId = _podId;
presentationNamesAC = PresentationPodManager.getInstance().getPod(podId).getPresentations(); // GOOD
presentationNamesAC = PresentationPodManager.getInstance().getPod(podId).getPresentations();
if (presentationNamesAC.length <= 0) {
selectFile();
}

View File

@ -286,6 +286,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function notifyOthersOfZoomEvent():void {
var presentEvent:PresenterCommands = new PresenterCommands(PresenterCommands.ZOOM);
presentEvent.podId = this.podId;
presentEvent.xOffset = slideModel.viewedRegionX;
presentEvent.yOffset = slideModel.viewedRegionY;
presentEvent.slideToCanvasWidthRatio = slideModel.viewedRegionW;

View File

@ -45,6 +45,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
import org.bigbluebutton.main.model.users.events.AddUserToPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.RemoveUserFromPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
<!--TODO: Move guest events to user events? -->
@ -115,6 +116,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{UserService}" method="removeUserFromPresenterGroup" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{RequestPresenterGroupEvent.REQUEST_PRESENTER_GROUP}" >
<MethodInvoker generator="{UserService}" method="handleRequestPresenterGroupEvent" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{BBBEvent.CHANGE_RECORDING_STATUS}">
<MethodInvoker generator="{UserService}" method="changeRecordingStatus" arguments="{event}" />
</EventHandlers>

View File

@ -209,6 +209,9 @@ package org.bigbluebutton.modules.users.services
case "UserRemovedFromPresenterGroupEvtMsg":
handleUserRemovedFromPresenterGroupEvtMsg(message);
break;
case "GetPresenterGroupRespMsg":
handleGetPresenterGroupRespMsg(message);
break;
}
}
@ -880,6 +883,14 @@ package org.bigbluebutton.modules.users.services
dispatcher.dispatchEvent(new UserRemovedFromPresenterGroupEvent(userId));
}
private function handleGetPresenterGroupRespMsg(msg: Object): void {
var presenterGroup: Array = msg.body.presenterGroup as Array;
for (var i: int = 0; i < presenterGroup.length; i++) {
var member: String = presenterGroup[i] as String;
dispatcher.dispatchEvent(new UserAddedToPresenterGroupEvent(member));
}
}
public function handleGuestPolicyChanged(msg:Object):void {
var header: Object = msg.header as Object;
var body: Object = msg.body as Object;

View File

@ -456,6 +456,20 @@ package org.bigbluebutton.modules.users.services
}, JSON.stringify(message));
}
public function handleRequestPresenterGroupEvent():void {
var message:Object = {
header: {name: "GetPresenterGroupReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
body: {requesterId: UsersUtil.getMyUserID()}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(
function(result:String):void { },
function(status:String):void { LOGGER.error(status); },
JSON.stringify(message)
);
}
public function getRoomMuteState():void{
var message:Object = {
header: {name: "IsMeetingMutedReqMsg", meetingId: UsersUtil.getInternalMeetingID(),

View File

@ -156,7 +156,7 @@ webcamsOnlyForModerator=false
#----------------------------------------------------
# This URL is where the BBB client is accessible. When a user sucessfully
# enters a name and password, she is redirected here to load the client.
bigbluebutton.web.serverURL=https://ritz-ss.blindside-dev.com
bigbluebutton.web.serverURL=http://192.168.246.131
#----------------------------------------------------