add/remove user from presenter groups
This commit is contained in:
parent
04cef71384
commit
030567368a
@ -49,10 +49,5 @@ object PresentationPodsApp {
|
||||
PresentationVO(pres.id, pres.name, pres.current, pres.pages.values.toVector, pres.downloadable)
|
||||
}
|
||||
|
||||
def verifyPresenterStatus(state: MeetingState2x, podId: String, userId: String): Option[String] = {
|
||||
// TODO check if the user belongs in the presenter group
|
||||
Some(userId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.bus.MessageBus
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.running.LiveMeeting
|
||||
import org.bigbluebutton.core.models.Users2x
|
||||
|
||||
trait SetCurrentPagePubMsgHdlr {
|
||||
|
||||
@ -28,12 +29,6 @@ trait SetCurrentPagePubMsgHdlr {
|
||||
bus.outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
// if (Users2x.isPresenter(msg.header.userId, liveMeeting.users2x)) {
|
||||
// if (setCurrentPage(liveMeeting, msg.body.presentationId, msg.body.pageId)) {
|
||||
// broadcastEvent(msg)
|
||||
// }
|
||||
// }
|
||||
|
||||
val podId = msg.body.podId
|
||||
val userId = msg.header.userId
|
||||
val presentationId = msg.body.presentationId
|
||||
@ -41,17 +36,18 @@ trait SetCurrentPagePubMsgHdlr {
|
||||
|
||||
val newState = for {
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
presenter <- PresentationPodsApp.verifyPresenterStatus(state, pod.id, userId)
|
||||
presentationToModify <- pod.getPresentation(presentationId)
|
||||
updatedPod <- pod.setCurrentPage(presentationId, pageId)
|
||||
} yield {
|
||||
|
||||
// if user is in the presenter group // TODO
|
||||
// if (Users2x.isPresenter(userId, liveMeeting.users2x)) {
|
||||
broadcastSetCurrentPageEvtMsg(pod.id, presentationId, pageId, userId)
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, userId)) {
|
||||
broadcastSetCurrentPageEvtMsg(pod.id, presentationId, pageId, userId)
|
||||
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
state.update(pods)
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
state.update(pods)
|
||||
} else {
|
||||
state
|
||||
}
|
||||
}
|
||||
|
||||
newState match {
|
||||
|
@ -0,0 +1,39 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.models.{ Roles, Users2x }
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
|
||||
trait AddUserToPresenterGroupCmdMsgHdlr {
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleAddUserToPresenterGroupCmdMsg(msg: AddUserToPresenterGroupCmdMsg) {
|
||||
|
||||
def broadcastAddUserToPresenterGroup(meetingId: String, userId: String, requesterId: String): Unit = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId)
|
||||
val envelope = BbbCoreEnvelope(UserAddedToPresenterGroupEvtMsg.NAME, routing)
|
||||
val header = BbbClientMsgHeader(UserAddedToPresenterGroupEvtMsg.NAME, meetingId, userId)
|
||||
val body = UserAddedToPresenterGroupEvtMsgBody(userId, requesterId)
|
||||
val event = UserAddedToPresenterGroupEvtMsg(header, body)
|
||||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
|
||||
|
||||
outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
val userId = msg.body.userId
|
||||
val requesterId = msg.body.requesterId
|
||||
|
||||
for {
|
||||
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId)
|
||||
} yield {
|
||||
if (requester.role == Roles.MODERATOR_ROLE) {
|
||||
Users2x.addUserToPresenterGroup(liveMeeting.users2x, userId)
|
||||
broadcastAddUserToPresenterGroup(liveMeeting.props.meetingProp.intId, userId, requesterId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.models.{ Roles, Users2x }
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
|
||||
trait RemoveUserFromPresenterGroupCmdMsgHdlr {
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleRemoveUserFromPresenterGroupCmdMsg(msg: RemoveUserFromPresenterGroupCmdMsg) {
|
||||
|
||||
def broadcastRemoveUserFromPresenterGroup(meetingId: String, userId: String, requesterId: String): Unit = {
|
||||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId)
|
||||
val envelope = BbbCoreEnvelope(UserRemovedFromPresenterGroupEvtMsg.NAME, routing)
|
||||
val header = BbbClientMsgHeader(UserRemovedFromPresenterGroupEvtMsg.NAME, meetingId, userId)
|
||||
val body = UserRemovedFromPresenterGroupEvtMsgBody(userId, requesterId)
|
||||
val event = UserRemovedFromPresenterGroupEvtMsg(header, body)
|
||||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
|
||||
|
||||
outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
val userId = msg.body.userId
|
||||
val requesterId = msg.body.requesterId
|
||||
|
||||
for {
|
||||
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId)
|
||||
} yield {
|
||||
if (requester.role == Roles.MODERATOR_ROLE) {
|
||||
Users2x.removeUserFromPresenterGroup(liveMeeting.users2x, userId)
|
||||
broadcastRemoveUserFromPresenterGroup(liveMeeting.props.meetingProp.intId, userId, requesterId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -21,6 +21,8 @@ class UsersApp(
|
||||
with SetRecordingStatusCmdMsgHdlr
|
||||
with GetRecordingStatusReqMsgHdlr
|
||||
with AssignPresenterReqMsgHdlr
|
||||
with AddUserToPresenterGroupCmdMsgHdlr
|
||||
with RemoveUserFromPresenterGroupCmdMsgHdlr
|
||||
with EjectUserFromMeetingCmdMsgHdlr {
|
||||
|
||||
val log = Logging(context.system, getClass)
|
||||
|
@ -106,10 +106,32 @@ object Users2x {
|
||||
def findModerator(users: Users2x): Option[UserState] = {
|
||||
users.toVector.find(u => u.role == Roles.MODERATOR_ROLE)
|
||||
}
|
||||
|
||||
def addUserToPresenterGroup(users: Users2x, userIdToAdd: String): Boolean = {
|
||||
// returns Boolean(successful operation)
|
||||
users.updatePresenterGroup(users.presenterGroup.:+(userIdToAdd))
|
||||
users.presenterGroup.contains(userIdToAdd)
|
||||
}
|
||||
|
||||
def removeUserFromPresenterGroup(users: Users2x, userIdToRemove: String): Boolean = {
|
||||
// returns Boolean(successful operation)
|
||||
users.updatePresenterGroup(users.presenterGroup.filterNot(_ == userIdToRemove))
|
||||
!users.presenterGroup.contains(userIdToRemove)
|
||||
}
|
||||
|
||||
def getPresenterGroupUsers(users2x: Users2x): Vector[String] = {
|
||||
users2x.presenterGroup
|
||||
}
|
||||
|
||||
def userIsInPresenterGroup(users2x: Users2x, userId: String): Boolean = {
|
||||
users2x.presenterGroup.contains(userId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Users2x {
|
||||
private var users: collection.immutable.HashMap[String, UserState] = new collection.immutable.HashMap[String, UserState]
|
||||
private var presenterGroup: Vector[String] = scala.collection.immutable.Vector.empty
|
||||
|
||||
// Collection of users that left the meeting. We keep a cache of the old users state to recover in case
|
||||
// the user reconnected by refreshing the client. (ralam june 13, 2017)
|
||||
@ -148,6 +170,11 @@ class Users2x {
|
||||
private def findUserFromCache(intId: String): Option[UserState] = {
|
||||
usersCache.values.find(u => u.intId == intId)
|
||||
}
|
||||
|
||||
private def updatePresenterGroup(updatedGroup: Vector[String]): Unit = {
|
||||
presenterGroup = updatedGroup
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case class UserState(intId: String, extId: String, name: String, role: String,
|
||||
|
@ -82,6 +82,11 @@ class ReceivedJsonMsgHandlerActor(
|
||||
// Users
|
||||
case GetUsersMeetingReqMsg.NAME =>
|
||||
routeGenericMsg[GetUsersMeetingReqMsg](envelope, jsonNode)
|
||||
case AddUserToPresenterGroupCmdMsg.NAME =>
|
||||
routeGenericMsg[AddUserToPresenterGroupCmdMsg](envelope, jsonNode)
|
||||
case RemoveUserFromPresenterGroupCmdMsg.NAME =>
|
||||
routeGenericMsg[RemoveUserFromPresenterGroupCmdMsg](envelope, jsonNode)
|
||||
|
||||
// Poll
|
||||
case StartCustomPollReqMsg.NAME =>
|
||||
routeGenericMsg[StartCustomPollReqMsg](envelope, jsonNode)
|
||||
|
@ -221,13 +221,16 @@ class MeetingActor(
|
||||
case m: UserJoinedVoiceConfEvtMsg => handleUserJoinedVoiceConfEvtMsg(m)
|
||||
case m: MeetingActivityResponseCmdMsg =>
|
||||
state = usersApp.handleMeetingActivityResponseCmdMsg(m, state)
|
||||
case m: LogoutAndEndMeetingCmdMsg => usersApp.handleLogoutAndEndMeetingCmdMsg(m, state)
|
||||
case m: SetRecordingStatusCmdMsg => usersApp.handleSetRecordingStatusCmdMsg(m)
|
||||
case m: GetRecordingStatusReqMsg => usersApp.handleGetRecordingStatusReqMsg(m)
|
||||
case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m)
|
||||
case m: EjectUserFromMeetingCmdMsg => usersApp.handleEjectUserFromMeetingCmdMsg(m)
|
||||
case m: GetUsersMeetingReqMsg => usersApp.handleGetUsersMeetingReqMsg(m)
|
||||
case m: ChangeUserRoleCmdMsg => usersApp.handleChangeUserRoleCmdMsg(m)
|
||||
case m: LogoutAndEndMeetingCmdMsg => usersApp.handleLogoutAndEndMeetingCmdMsg(m, state)
|
||||
case m: SetRecordingStatusCmdMsg => usersApp.handleSetRecordingStatusCmdMsg(m)
|
||||
case m: GetRecordingStatusReqMsg => usersApp.handleGetRecordingStatusReqMsg(m)
|
||||
case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m)
|
||||
case m: EjectUserFromMeetingCmdMsg => usersApp.handleEjectUserFromMeetingCmdMsg(m)
|
||||
case m: GetUsersMeetingReqMsg => usersApp.handleGetUsersMeetingReqMsg(m)
|
||||
case m: ChangeUserRoleCmdMsg => usersApp.handleChangeUserRoleCmdMsg(m)
|
||||
case m: AddUserToPresenterGroupCmdMsg => usersApp.handleAddUserToPresenterGroupCmdMsg(m)
|
||||
case m: RemoveUserFromPresenterGroupCmdMsg =>
|
||||
usersApp.handleRemoveUserFromPresenterGroupCmdMsg(m)
|
||||
|
||||
// Whiteboard
|
||||
case m: SendCursorPositionPubMsg => wbApp.handle(m, liveMeeting, msgBus)
|
||||
|
@ -283,3 +283,30 @@ case class GetVoiceUsersMeetingRespMsgBody(users: Vector[VoiceConfUser])
|
||||
case class VoiceConfUser(intId: String, voiceUserId: String, callingWith: String, callerName: String,
|
||||
callerNum: String, muted: Boolean, talking: Boolean, listenOnly: Boolean)
|
||||
|
||||
/**
|
||||
* Sent from client to add user to the presenter group of a meeting.
|
||||
*/
|
||||
object AddUserToPresenterGroupCmdMsg { val NAME = "AddUserToPresenterGroupCmdMsg" }
|
||||
case class AddUserToPresenterGroupCmdMsg(header: BbbClientMsgHeader, body: AddUserToPresenterGroupCmdMsgBody) extends StandardMsg
|
||||
case class AddUserToPresenterGroupCmdMsgBody(userId: String, requesterId: String)
|
||||
|
||||
/**
|
||||
* Sent to all clients about a user added to the presenter group of a meeting
|
||||
*/
|
||||
object UserAddedToPresenterGroupEvtMsg { val NAME = "UserAddedToPresenterGroupEvtMsg" }
|
||||
case class UserAddedToPresenterGroupEvtMsg(header: BbbClientMsgHeader, body: UserAddedToPresenterGroupEvtMsgBody) extends StandardMsg
|
||||
case class UserAddedToPresenterGroupEvtMsgBody(userId: String, requesterId: String)
|
||||
|
||||
/**
|
||||
* Sent from client to remove user from the presenter group of a meeting.
|
||||
*/
|
||||
object RemoveUserFromPresenterGroupCmdMsg { val NAME = "RemoveUserFromPresenterGroupCmdMsg" }
|
||||
case class RemoveUserFromPresenterGroupCmdMsg(header: BbbClientMsgHeader, body: RemoveUserFromPresenterGroupCmdMsgBody) extends StandardMsg
|
||||
case class RemoveUserFromPresenterGroupCmdMsgBody(userId: String, requesterId: String)
|
||||
|
||||
/**
|
||||
* Sent to all clients about a user removed from the presenter group of a meeting
|
||||
*/
|
||||
object UserRemovedFromPresenterGroupEvtMsg { val NAME = "UserRemovedFromPresenterGroupEvtMsg" }
|
||||
case class UserRemovedFromPresenterGroupEvtMsg(header: BbbClientMsgHeader, body: UserRemovedFromPresenterGroupEvtMsgBody) extends StandardMsg
|
||||
case class UserRemovedFromPresenterGroupEvtMsgBody(userId: String, requesterId: String)
|
||||
|
@ -215,6 +215,8 @@ bbb.users.usersGrid.mediaItemRenderer.pushToMute = Mute {0}
|
||||
bbb.users.usersGrid.mediaItemRenderer.pushToLock = Lock {0}
|
||||
bbb.users.usersGrid.mediaItemRenderer.pushToUnlock = Unlock {0}
|
||||
bbb.users.usersGrid.mediaItemRenderer.kickUser = Kick {0}
|
||||
bbb.users.usersGrid.mediaItemRenderer.addUserToPresenterGroup = Add {0} to presenter group
|
||||
bbb.users.usersGrid.mediaItemRenderer.removeUserFromPresenterGroup = Remove {0} from presenter group
|
||||
bbb.users.usersGrid.mediaItemRenderer.webcam = Webcam shared
|
||||
bbb.users.usersGrid.mediaItemRenderer.micOff = Microphone off
|
||||
bbb.users.usersGrid.mediaItemRenderer.micOn = Microphone on
|
||||
|
@ -49,6 +49,8 @@ package org.bigbluebutton.main.model.users
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
|
||||
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.modules.users.services.MessageReceiver;
|
||||
import org.bigbluebutton.modules.users.services.MessageSender;
|
||||
|
||||
@ -262,6 +264,14 @@ package org.bigbluebutton.main.model.users
|
||||
if (this.isModerator()) sender.kickUser(e.userid);
|
||||
}
|
||||
|
||||
public function addUserToPresenterGroup(e: AddUserToPresenterGroupEvent): void {
|
||||
if (this.isModerator()) sender.addUserToPresenterGroup(e.userId);
|
||||
}
|
||||
|
||||
public function removeUserFromPresenterGroup(e: RemoveUserFromPresenterGroupEvent): void {
|
||||
if (this.isModerator()) sender.removeUserFromPresenterGroup(e.userId);
|
||||
}
|
||||
|
||||
public function changeRole(e:ChangeRoleEvent):void {
|
||||
if (this.isModerator()) sender.changeRole(e.userid, e.role);
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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 AddUserToPresenterGroupEvent extends Event
|
||||
{
|
||||
public static const ADD_USER_TO_PRESENTER_GROUP:String = "ADD_USER_TO_PRESENTER_GROUP";
|
||||
|
||||
public var userId:String;
|
||||
|
||||
public function AddUserToPresenterGroupEvent(userId:String)
|
||||
{
|
||||
this.userId = userId;
|
||||
super(ADD_USER_TO_PRESENTER_GROUP, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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 RemoveUserFromPresenterGroupEvent extends Event
|
||||
{
|
||||
public static const REMOVE_USER_FROM_PRESENTER_GROUP:String = "REMOVE_USER_FROM_PRESENTER_GROUP";
|
||||
|
||||
public var userId:String;
|
||||
|
||||
public function RemoveUserFromPresenterGroupEvent(userId:String)
|
||||
{
|
||||
this.userId = userId;
|
||||
super(REMOVE_USER_FROM_PRESENTER_GROUP, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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 UserAddedToPresenterGroupEvent extends Event
|
||||
{
|
||||
public static const USER_ADDED_TO_PRESENTER_GROUP:String = "USER_ADDED_TO_PRESENTER_GROUP";
|
||||
|
||||
public var userId:String;
|
||||
|
||||
public function UserAddedToPresenterGroupEvent(userId:String)
|
||||
{
|
||||
this.userId = userId;
|
||||
super(USER_ADDED_TO_PRESENTER_GROUP, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 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 UserRemovedFromPresenterGroupEvent extends Event
|
||||
{
|
||||
public static const USER_REMOVED_FROM_PRESENTER_GROUP:String = "USER_REMOVED_FROM_PRESENTER_GROUP";
|
||||
|
||||
public var userId:String;
|
||||
|
||||
public function UserRemovedFromPresenterGroupEvent(userId:String)
|
||||
{
|
||||
this.userId = userId;
|
||||
super(USER_REMOVED_FROM_PRESENTER_GROUP, true, false);
|
||||
}
|
||||
}
|
||||
}
|
@ -43,6 +43,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.main.model.users.events.EmojiStatusEvent;
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
|
||||
import org.bigbluebutton.main.model.users.events.AddUserToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RemoveUserFromPresenterGroupEvent;
|
||||
<!--TODO: Move guest events to user events? -->
|
||||
|
||||
|
||||
@ -104,7 +106,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<EventHandlers type="{KickUserEvent.KICK_USER}" >
|
||||
<MethodInvoker generator="{UserService}" method="kickUser" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
|
||||
<EventHandlers type="{AddUserToPresenterGroupEvent.ADD_USER_TO_PRESENTER_GROUP}" >
|
||||
<MethodInvoker generator="{UserService}" method="addUserToPresenterGroup" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{RemoveUserFromPresenterGroupEvent.REMOVE_USER_FROM_PRESENTER_GROUP}" >
|
||||
<MethodInvoker generator="{UserService}" method="removeUserFromPresenterGroup" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{BBBEvent.CHANGE_RECORDING_STATUS}">
|
||||
<MethodInvoker generator="{UserService}" method="changeRecordingStatus" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
@ -52,6 +52,8 @@ package org.bigbluebutton.modules.users.services
|
||||
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
|
||||
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.StreamStoppedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.UserAddedToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.UserRemovedFromPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.screenshare.events.WebRTCViewStreamEvent;
|
||||
import org.bigbluebutton.modules.users.events.MeetingMutedEvent;
|
||||
|
||||
@ -200,6 +202,12 @@ package org.bigbluebutton.modules.users.services
|
||||
case "GuestsWaitingApprovedEvtMsg":
|
||||
handleGuestsWaitingApprovedEvtMsg(message);
|
||||
break;
|
||||
case "UserAddedToPresenterGroupEvtMsg":
|
||||
handleUserAddedToPresenterGroupEvtMsg(message);
|
||||
break;
|
||||
case "UserRemovedFromPresenterGroupEvtMsg":
|
||||
handleUserRemovedFromPresenterGroupEvtMsg(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -851,7 +859,17 @@ package org.bigbluebutton.modules.users.services
|
||||
dispatcher.dispatchEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function handleUserAddedToPresenterGroupEvtMsg(msg: Object): void {
|
||||
var userId: String = msg.body.userId;
|
||||
dispatcher.dispatchEvent(new UserAddedToPresenterGroupEvent(userId));
|
||||
}
|
||||
|
||||
private function handleUserRemovedFromPresenterGroupEvtMsg(msg: Object): void {
|
||||
var userId: String = msg.body.userId;
|
||||
dispatcher.dispatchEvent(new UserRemovedFromPresenterGroupEvent(userId));
|
||||
}
|
||||
|
||||
public function handleGuestPolicyChanged(msg:Object):void {
|
||||
var header: Object = msg.header as Object;
|
||||
var body: Object = msg.body as Object;
|
||||
|
@ -424,7 +424,39 @@ package org.bigbluebutton.modules.users.services
|
||||
}, JSON.stringify(message));
|
||||
}
|
||||
|
||||
public function getRoomMuteState():void{
|
||||
public function addUserToPresenterGroup(userID:String):void {
|
||||
var message:Object = {
|
||||
header: {name: "AddUserToPresenterGroupCmdMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
|
||||
body: {userId: userID, requesterId: UsersUtil.getMyUserID()}
|
||||
};
|
||||
|
||||
var _nc:ConnectionManager = BBB.initConnectionManager();
|
||||
_nc.sendMessage2x(function(result:String):void { // On successful result
|
||||
}, function(status:String):void { // status - On error occurred
|
||||
var logData:Object = UsersUtil.initLogData();
|
||||
logData.tags = ["apps"];
|
||||
logData.message = "Error occurred adding a user to presenter group.";
|
||||
LOGGER.info(JSON.stringify(logData));
|
||||
}, JSON.stringify(message));
|
||||
}
|
||||
|
||||
public function removeUserFromPresenterGroup(userID:String):void {
|
||||
var message:Object = {
|
||||
header: {name: "RemoveUserFromPresenterGroupCmdMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
|
||||
body: {userId: userID, requesterId: UsersUtil.getMyUserID()}
|
||||
};
|
||||
|
||||
var _nc:ConnectionManager = BBB.initConnectionManager();
|
||||
_nc.sendMessage2x(function(result:String):void { // On successful result
|
||||
}, function(status:String):void { // status - On error occurred
|
||||
var logData:Object = UsersUtil.initLogData();
|
||||
logData.tags = ["apps"];
|
||||
logData.message = "Error occurred removing a user from presenter group.";
|
||||
LOGGER.info(JSON.stringify(logData));
|
||||
}, JSON.stringify(message));
|
||||
}
|
||||
|
||||
public function getRoomMuteState():void{
|
||||
var message:Object = {
|
||||
header: {name: "IsMeetingMutedReqMsg", meetingId: UsersUtil.getInternalMeetingID(),
|
||||
userId: UsersUtil.getMyUserID()},
|
||||
|
@ -51,6 +51,8 @@
|
||||
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
|
||||
import org.bigbluebutton.main.model.users.events.ChangeRoleEvent;
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.model.users.events.AddUserToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RemoveUserFromPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.users.events.UsersRollEvent;
|
||||
import org.bigbluebutton.modules.users.events.ViewCameraEvent;
|
||||
import org.bigbluebutton.modules.users.model.UsersOptions;
|
||||
@ -151,7 +153,15 @@
|
||||
dispatchEvent(new KickUserEvent(data.userId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function addToPresenterGroup(): void {
|
||||
dispatchEvent(new AddUserToPresenterGroupEvent(data.userId));
|
||||
}
|
||||
|
||||
private function removeFromPresenterGroup(): void {
|
||||
dispatchEvent(new RemoveUserFromPresenterGroupEvent(data.userId));
|
||||
}
|
||||
|
||||
private function toggleMuteState():void {
|
||||
var e:VoiceConfEvent = new VoiceConfEvent(VoiceConfEvent.MUTE_USER);
|
||||
e.userid = data.userId;
|
||||
@ -323,6 +333,20 @@
|
||||
});
|
||||
}
|
||||
|
||||
if (true) { // TODO if belongs to Presenter group
|
||||
myMenuData.push({
|
||||
label: ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.addUserToPresenterGroup',[data.name]),
|
||||
icon: getStyle('iconEject'),
|
||||
callback: addToPresenterGroup
|
||||
});
|
||||
} else {
|
||||
myMenuData.push({
|
||||
label: ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.removeUserFromPresenterGroup',[data.name]),
|
||||
icon: getStyle('iconEject'),
|
||||
callback: removeFromPresenterGroup
|
||||
});
|
||||
}
|
||||
|
||||
// make sure the previous menu is closed before opening a new one
|
||||
// This could be improved to include a flag that tells if the menu is open,
|
||||
// but it would require an extra listener for the MenuCloseEvent.
|
||||
|
Loading…
Reference in New Issue
Block a user