Merge pull request #4917 from ritzalam/remove-presenter-group
Remove presenter group
This commit is contained in:
commit
fbb4019812
@ -51,15 +51,18 @@ trait PresentationUploadTokenReqMsgHdlr extends RightsManagementTrait {
|
||||
}
|
||||
|
||||
def userIsAllowedToUploadInPod(podId: String, userId: String): Boolean = {
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, userId)) {
|
||||
for {
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
} yield {
|
||||
return pod.currentPresenter == userId
|
||||
var allowed = false
|
||||
|
||||
for {
|
||||
user <- Users2x.findWithIntId(liveMeeting.users2x, userId)
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
} yield {
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, userId)) {
|
||||
allowed = pod.currentPresenter == userId
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
allowed
|
||||
}
|
||||
|
||||
log.info("handlePresentationUploadTokenReqMsg" + liveMeeting.props.meetingProp.intId +
|
||||
|
@ -1,24 +1,42 @@
|
||||
package org.bigbluebutton.core.apps.presentationpod
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.apps.users.AssignPresenterActionHandler
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.bus.MessageBus
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.running.LiveMeeting
|
||||
import org.bigbluebutton.core.models.Users2x
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
import org.bigbluebutton.core.models.{ PresentationPod, Users2x }
|
||||
|
||||
trait SetPresenterInPodReqMsgHdlr extends RightsManagementTrait {
|
||||
trait SetPresenterInPodReqMsgHdlr {
|
||||
this: PresentationPodHdlrs =>
|
||||
|
||||
def handle(
|
||||
msg: SetPresenterInPodReqMsg, state: MeetingState2x,
|
||||
liveMeeting: LiveMeeting, bus: MessageBus
|
||||
): MeetingState2x = {
|
||||
if (msg.body.podId == PresentationPod.DEFAULT_PRESENTATION_POD) {
|
||||
// Swith presenter as default presenter pod has changed.
|
||||
AssignPresenterActionHandler.handleAction(liveMeeting, bus.outGW, msg.header.userId, msg.body.nextPresenterId)
|
||||
}
|
||||
SetPresenterInPodActionHandler.handleAction(state, liveMeeting, bus.outGW, msg.header.userId, msg.body.podId, msg.body.nextPresenterId)
|
||||
}
|
||||
}
|
||||
|
||||
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
|
||||
object SetPresenterInPodActionHandler extends RightsManagementTrait {
|
||||
def handleAction(
|
||||
state: MeetingState2x,
|
||||
liveMeeting: LiveMeeting,
|
||||
outGW: OutMsgRouter,
|
||||
assignedBy: String,
|
||||
podId: String,
|
||||
newPresenterId: String
|
||||
): MeetingState2x = {
|
||||
|
||||
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, assignedBy)) {
|
||||
val meetingId = liveMeeting.props.meetingProp.intId
|
||||
val reason = "No permission to set presenter in presentation pod."
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting)
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, assignedBy, reason, outGW, liveMeeting)
|
||||
state
|
||||
} else {
|
||||
def broadcastSetPresenterInPodRespMsg(podId: String, nextPresenterId: String, requesterId: String): Unit = {
|
||||
@ -32,32 +50,22 @@ trait SetPresenterInPodReqMsgHdlr extends RightsManagementTrait {
|
||||
val body = SetPresenterInPodRespMsgBody(podId, nextPresenterId)
|
||||
val event = SetPresenterInPodRespMsg(header, body)
|
||||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
|
||||
bus.outGW.send(msgEvent)
|
||||
outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
val podId: String = msg.body.podId
|
||||
val requesterId: String = msg.header.userId
|
||||
val nextPresenterId: String = msg.body.nextPresenterId
|
||||
|
||||
val newState = for {
|
||||
user <- Users2x.findWithIntId(liveMeeting.users2x, newPresenterId)
|
||||
pod <- PresentationPodsApp.getPresentationPod(state, podId)
|
||||
} yield {
|
||||
|
||||
if (Users2x.userIsInPresenterGroup(liveMeeting.users2x, nextPresenterId)) {
|
||||
|
||||
if (pod.currentPresenter != "") {
|
||||
liveMeeting.users2x.addOldPresenter(pod.currentPresenter)
|
||||
}
|
||||
|
||||
val updatedPod = pod.setCurrentPresenter(nextPresenterId)
|
||||
|
||||
broadcastSetPresenterInPodRespMsg(pod.id, nextPresenterId, requesterId)
|
||||
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
state.update(pods)
|
||||
} else {
|
||||
state
|
||||
if (pod.currentPresenter != "") {
|
||||
Users2x.removeUserFromPresenterGroup(liveMeeting.users2x, pod.currentPresenter)
|
||||
liveMeeting.users2x.addOldPresenter(pod.currentPresenter)
|
||||
}
|
||||
Users2x.addUserToPresenterGroup(liveMeeting.users2x, newPresenterId)
|
||||
val updatedPod = pod.setCurrentPresenter(newPresenterId)
|
||||
broadcastSetPresenterInPodRespMsg(pod.id, newPresenterId, assignedBy)
|
||||
val pods = state.presentationPodManager.addPod(updatedPod)
|
||||
state.update(pods)
|
||||
}
|
||||
|
||||
newState match {
|
||||
@ -65,6 +73,5 @@ trait SetPresenterInPodReqMsgHdlr extends RightsManagementTrait {
|
||||
case None => state
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
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 }
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
|
||||
trait AddUserToPresenterGroupCmdMsgHdlr extends RightsManagementTrait {
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleAddUserToPresenterGroupCmdMsg(msg: AddUserToPresenterGroupCmdMsg) {
|
||||
|
||||
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
|
||||
val meetingId = liveMeeting.props.meetingProp.intId
|
||||
val reason = "No permission to add user to presenter group."
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
|
||||
} else {
|
||||
val userId = msg.body.userId
|
||||
val requesterId = msg.body.requesterId
|
||||
|
||||
for {
|
||||
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId)
|
||||
} yield {
|
||||
if (requester.role == Roles.MODERATOR_ROLE) {
|
||||
UsersApp.addUserToPresenterGroup(liveMeeting, outGW, userId, requesterId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.models.{ UserState, Users2x }
|
||||
import org.bigbluebutton.core.apps.presentationpod.SetPresenterInPodActionHandler
|
||||
import org.bigbluebutton.core.models.{ PresentationPod, UserState, Users2x }
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
|
||||
trait AssignPresenterReqMsgHdlr extends RightsManagementTrait {
|
||||
this: UsersApp =>
|
||||
@ -11,19 +13,31 @@ trait AssignPresenterReqMsgHdlr extends RightsManagementTrait {
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleAssignPresenterReqMsg(msg: AssignPresenterReqMsg) {
|
||||
def handleAssignPresenterReqMsg(msg: AssignPresenterReqMsg, state: MeetingState2x): MeetingState2x = {
|
||||
AssignPresenterActionHandler.handleAction(liveMeeting, outGW, msg.body.assignedBy, msg.body.newPresenterId)
|
||||
|
||||
// Change presenter of default presentation pod
|
||||
SetPresenterInPodActionHandler.handleAction(state, liveMeeting, outGW,
|
||||
msg.header.userId, PresentationPod.DEFAULT_PRESENTATION_POD,
|
||||
msg.body.newPresenterId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object AssignPresenterActionHandler extends RightsManagementTrait {
|
||||
|
||||
def handleAction(liveMeeting: LiveMeeting, outGW: OutMsgRouter, assignedBy: String, newPresenterId: String): Unit = {
|
||||
def broadcastOldPresenterChange(oldPres: UserState): Unit = {
|
||||
// unassign old presenter
|
||||
val routingUnassign = Routing.addMsgToClientRouting(
|
||||
MessageTypes.BROADCAST_TO_MEETING,
|
||||
this.liveMeeting.props.meetingProp.intId, oldPres.intId
|
||||
liveMeeting.props.meetingProp.intId, oldPres.intId
|
||||
)
|
||||
val envelopeUnassign = BbbCoreEnvelope(PresenterUnassignedEvtMsg.NAME, routingUnassign)
|
||||
val headerUnassign = BbbClientMsgHeader(PresenterUnassignedEvtMsg.NAME, this.liveMeeting.props.meetingProp.intId,
|
||||
val headerUnassign = BbbClientMsgHeader(PresenterUnassignedEvtMsg.NAME, liveMeeting.props.meetingProp.intId,
|
||||
oldPres.intId)
|
||||
|
||||
val bodyUnassign = PresenterUnassignedEvtMsgBody(oldPres.intId, oldPres.name, msg.body.assignedBy)
|
||||
val bodyUnassign = PresenterUnassignedEvtMsgBody(oldPres.intId, oldPres.name, assignedBy)
|
||||
val eventUnassign = PresenterUnassignedEvtMsg(headerUnassign, bodyUnassign)
|
||||
val msgEventUnassign = BbbCommonEnvCoreMsg(envelopeUnassign, eventUnassign)
|
||||
outGW.send(msgEventUnassign)
|
||||
@ -33,37 +47,36 @@ trait AssignPresenterReqMsgHdlr extends RightsManagementTrait {
|
||||
// set new presenter
|
||||
val routingAssign = Routing.addMsgToClientRouting(
|
||||
MessageTypes.BROADCAST_TO_MEETING,
|
||||
this.liveMeeting.props.meetingProp.intId, newPres.intId
|
||||
liveMeeting.props.meetingProp.intId, newPres.intId
|
||||
)
|
||||
val envelopeAssign = BbbCoreEnvelope(PresenterAssignedEvtMsg.NAME, routingAssign)
|
||||
val headerAssign = BbbClientMsgHeader(PresenterAssignedEvtMsg.NAME, this.liveMeeting.props.meetingProp.intId,
|
||||
val headerAssign = BbbClientMsgHeader(PresenterAssignedEvtMsg.NAME, liveMeeting.props.meetingProp.intId,
|
||||
newPres.intId)
|
||||
|
||||
val bodyAssign = PresenterAssignedEvtMsgBody(newPres.intId, newPres.name, msg.body.assignedBy)
|
||||
val bodyAssign = PresenterAssignedEvtMsgBody(newPres.intId, newPres.name, assignedBy)
|
||||
val eventAssign = PresenterAssignedEvtMsg(headerAssign, bodyAssign)
|
||||
val msgEventAssign = BbbCommonEnvCoreMsg(envelopeAssign, eventAssign)
|
||||
outGW.send(msgEventAssign)
|
||||
}
|
||||
|
||||
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
|
||||
if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, assignedBy)) {
|
||||
val meetingId = liveMeeting.props.meetingProp.intId
|
||||
val reason = "No permission to change presenter in meeting."
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, assignedBy, reason, outGW, liveMeeting)
|
||||
} else {
|
||||
for {
|
||||
oldPres <- Users2x.findPresenter(this.liveMeeting.users2x)
|
||||
oldPres <- Users2x.findPresenter(liveMeeting.users2x)
|
||||
} yield {
|
||||
Users2x.makeNotPresenter(this.liveMeeting.users2x, oldPres.intId)
|
||||
Users2x.makeNotPresenter(liveMeeting.users2x, oldPres.intId)
|
||||
broadcastOldPresenterChange(oldPres)
|
||||
}
|
||||
|
||||
for {
|
||||
newPres <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.newPresenterId)
|
||||
newPres <- Users2x.findWithIntId(liveMeeting.users2x, newPresenterId)
|
||||
} yield {
|
||||
Users2x.makePresenter(this.liveMeeting.users2x, newPres.intId)
|
||||
Users2x.makePresenter(liveMeeting.users2x, newPres.intId)
|
||||
broadcastNewPresenterChange(newPres)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@ import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.models.{ Roles, Users2x }
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.models.Users2x.findWithIntId
|
||||
|
||||
trait ChangeUserRoleCmdMsgHdlr extends RightsManagementTrait {
|
||||
this: UsersApp =>
|
||||
|
@ -1,37 +0,0 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.apps.presentationpod.PresentationPodsApp
|
||||
import org.bigbluebutton.core.models.{ Roles, Users2x }
|
||||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
|
||||
trait RemoveUserFromPresenterGroupCmdMsgHdlr extends RightsManagementTrait {
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleRemoveUserFromPresenterGroupCmdMsg(msg: RemoveUserFromPresenterGroupCmdMsg, state: MeetingState2x): MeetingState2x = {
|
||||
|
||||
def broadcastSetPresenterInPodRespMsg(podId: String, nextPresenterId: String, requesterId: String): Unit = {
|
||||
val routing = Routing.addMsgToClientRouting(
|
||||
MessageTypes.BROADCAST_TO_MEETING,
|
||||
liveMeeting.props.meetingProp.intId, requesterId
|
||||
)
|
||||
val envelope = BbbCoreEnvelope(SetPresenterInPodRespMsg.NAME, routing)
|
||||
val header = BbbClientMsgHeader(SetPresenterInPodRespMsg.NAME, liveMeeting.props.meetingProp.intId, requesterId)
|
||||
|
||||
val body = SetPresenterInPodRespMsgBody(podId, nextPresenterId)
|
||||
val event = SetPresenterInPodRespMsg(header, body)
|
||||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
|
||||
outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
var newState = state
|
||||
|
||||
if (permissionFailed(
|
||||
PermissionCheck.MOD_LEVEL,
|
||||
PermissionCheck.VIEWER_LEVEL,
|
||||
liveMeeting.users2x,
|
||||
msg.header.userId
|
||||
)) {
|
||||
val meetingId = liveMeeting.props.meetingProp.intId
|
||||
val reason = "No permission to remove user from presenter group."
|
||||
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, outGW, liveMeeting)
|
||||
} else {
|
||||
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)
|
||||
outGW.send(buildRemoveUserFromPresenterGroup(liveMeeting.props.meetingProp.intId, userId, requesterId))
|
||||
|
||||
val pods = PresentationPodsApp.findPodsWhereUserIsPresenter(state.presentationPodManager, userId)
|
||||
if (pods.length > 0) {
|
||||
val presenters = Users2x.getPresenterGroupUsers(liveMeeting.users2x)
|
||||
var newPresenter = ""
|
||||
if (presenters.length > 0) {
|
||||
newPresenter = presenters.head
|
||||
}
|
||||
|
||||
pods foreach { pod =>
|
||||
val updatedPod = pod.setCurrentPresenter(newPresenter)
|
||||
broadcastSetPresenterInPodRespMsg(pod.id, newPresenter, "system")
|
||||
val newpods = state.presentationPodManager.addPod(updatedPod)
|
||||
newState = state.update(newpods)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newState
|
||||
}
|
||||
|
||||
}
|
@ -21,15 +21,6 @@ object UsersApp {
|
||||
outGW.send(msgEvent)
|
||||
}
|
||||
|
||||
def addUserToPresenterGroup(liveMeeting: LiveMeeting, outGW: OutMsgRouter,
|
||||
userId: String, requesterId: String): Unit = {
|
||||
Users2x.addUserToPresenterGroup(liveMeeting.users2x, userId)
|
||||
UsersApp.broadcastAddUserToPresenterGroup(
|
||||
liveMeeting.props.meetingProp.intId,
|
||||
userId, requesterId, outGW
|
||||
)
|
||||
}
|
||||
|
||||
def approveOrRejectGuest(liveMeeting: LiveMeeting, outGW: OutMsgRouter,
|
||||
guest: GuestApprovedVO, approvedBy: String): Unit = {
|
||||
for {
|
||||
@ -140,9 +131,6 @@ class UsersApp(
|
||||
with SetRecordingStatusCmdMsgHdlr
|
||||
with GetRecordingStatusReqMsgHdlr
|
||||
with AssignPresenterReqMsgHdlr
|
||||
with AddUserToPresenterGroupCmdMsgHdlr
|
||||
with RemoveUserFromPresenterGroupCmdMsgHdlr
|
||||
with GetPresenterGroupReqMsgHdlr
|
||||
with EjectDuplicateUserReqMsgHdlr
|
||||
with EjectUserFromMeetingCmdMsgHdlr
|
||||
with MuteUserCmdMsgHdlr {
|
||||
|
@ -14,7 +14,7 @@ object PresentationPodFactory {
|
||||
def createDefaultPod(): PresentationPod = {
|
||||
// we hardcode the podId of the default presentation pod for the purposes of having bbb-web know the podId
|
||||
// in advance (so we can fully process default.pdf)
|
||||
PresentationPod("DEFAULT_PRESENTATION_POD", "", Map.empty)
|
||||
PresentationPod(PresentationPod.DEFAULT_PRESENTATION_POD, "", Map.empty)
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,6 +39,10 @@ case class PresentationInPod(id: String, name: String, current: Boolean = false,
|
||||
|
||||
}
|
||||
|
||||
object PresentationPod {
|
||||
val DEFAULT_PRESENTATION_POD = "DEFAULT_PRESENTATION_POD"
|
||||
}
|
||||
|
||||
case class PresentationPod(id: String, currentPresenter: String,
|
||||
presentations: collection.immutable.Map[String, PresentationInPod]) {
|
||||
def addPresentation(presentation: PresentationInPod): PresentationPod = {
|
||||
@ -160,7 +164,7 @@ case class PresentationPodManager(presentationPods: collection.immutable.Map[Str
|
||||
|
||||
def getNumberOfPods(): Int = presentationPods.size
|
||||
def getPod(podId: String): Option[PresentationPod] = presentationPods.get(podId)
|
||||
def getDefaultPod(): Option[PresentationPod] = presentationPods.get("DEFAULT_PRESENTATION_POD")
|
||||
def getDefaultPod(): Option[PresentationPod] = presentationPods.get(PresentationPod.DEFAULT_PRESENTATION_POD)
|
||||
def getAllPresentationPodsInMeeting(): Vector[PresentationPod] = presentationPods.values.toVector
|
||||
def updatePresentationPod(presPod: PresentationPod): PresentationPodManager = addPod(presPod)
|
||||
|
||||
|
@ -231,4 +231,4 @@ object EjectReasonCode {
|
||||
val PERMISSION_FAILED = "not_enough_permission_eject_reason"
|
||||
val EJECT_USER = "user_requested_eject_reason"
|
||||
val VALIDATE_TOKEN = "validate_token_failed_eject_reason"
|
||||
}
|
||||
}
|
||||
|
@ -56,10 +56,6 @@ trait HandlerHelpers extends SystemConfiguration {
|
||||
UsersApp.automaticallyAssignPresenter(outGW, liveMeeting)
|
||||
}
|
||||
|
||||
if (newUser.role == Roles.MODERATOR_ROLE) {
|
||||
UsersApp.addUserToPresenterGroup(liveMeeting, outGW, newUser.intId, newUser.intId)
|
||||
}
|
||||
|
||||
state.update(state.expiryTracker.setUserHasJoined())
|
||||
case None =>
|
||||
state
|
||||
|
@ -35,6 +35,7 @@ import org.bigbluebutton.core.apps.layout.LayoutApp2x
|
||||
import org.bigbluebutton.core.apps.meeting.{ SyncGetMeetingInfoRespMsgHdlr, ValidateConnAuthTokenSysMsgHdlr }
|
||||
import org.bigbluebutton.core.apps.users.ChangeLockSettingsInMeetingCmdMsgHdlr
|
||||
import org.bigbluebutton.core2.message.senders.MsgBuilder
|
||||
import org.bigbluebutton.core2.testdata.FakeTestData
|
||||
|
||||
object MeetingActor {
|
||||
def props(
|
||||
@ -162,6 +163,7 @@ class MeetingActor(
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
// Helper to create fake users for testing (ralam jan 5, 2018)
|
||||
//object FakeTestData extends FakeTestData
|
||||
//FakeTestData.createFakeUsers(liveMeeting)
|
||||
/*******************************************************************/
|
||||
@ -226,9 +228,6 @@ class MeetingActor(
|
||||
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 => state = usersApp.handleRemoveUserFromPresenterGroupCmdMsg(m, state)
|
||||
case m: GetPresenterGroupReqMsg => usersApp.handleGetPresenterGroupReqMsg(m)
|
||||
|
||||
// Whiteboard
|
||||
case m: SendCursorPositionPubMsg => wbApp.handle(m, liveMeeting, msgBus)
|
||||
@ -281,7 +280,7 @@ class MeetingActor(
|
||||
|
||||
// Presentation
|
||||
case m: PreuploadedPresentationsSysPubMsg => presentationApp2x.handle(m, liveMeeting, msgBus)
|
||||
case m: AssignPresenterReqMsg => handlePresenterChange(m)
|
||||
case m: AssignPresenterReqMsg => state = handlePresenterChange(m, state)
|
||||
|
||||
// Presentation Pods
|
||||
case m: CreateNewPresentationPodPubMsg => state = presentationPodsApp.handle(m, state, liveMeeting, msgBus)
|
||||
@ -358,12 +357,12 @@ class MeetingActor(
|
||||
// TODO send all screen sharing info
|
||||
}
|
||||
|
||||
def handlePresenterChange(msg: AssignPresenterReqMsg): Unit = {
|
||||
def handlePresenterChange(msg: AssignPresenterReqMsg, state: MeetingState2x): MeetingState2x = {
|
||||
// Stop poll if one is running as presenter left
|
||||
pollApp.stopPoll(state, msg.header.userId, liveMeeting, msgBus)
|
||||
|
||||
// switch user presenter status for old and new presenter
|
||||
usersApp.handleAssignPresenterReqMsg(msg)
|
||||
val newState = usersApp.handleAssignPresenterReqMsg(msg, state)
|
||||
|
||||
// request screenshare to end
|
||||
screenshareApp2x.handleScreenshareStoppedVoiceConfEvtMsg(
|
||||
@ -372,6 +371,8 @@ class MeetingActor(
|
||||
liveMeeting, msgBus
|
||||
)
|
||||
|
||||
newState
|
||||
|
||||
}
|
||||
|
||||
def handleDeskShareGetDeskShareInfoRequest(msg: DeskShareGetDeskShareInfoRequest): Unit = {
|
||||
|
@ -41,6 +41,11 @@ trait FakeTestData {
|
||||
val vu5 = FakeUserGenerator.createFakeVoiceOnlyUser(CallingWith.PHONE, muted = false, talking = false, listenOnly = false)
|
||||
VoiceUsers.add(liveMeeting.voiceUsers, vu5)
|
||||
|
||||
for (i <- 1 to 50) {
|
||||
val guser = createUserVoiceAndCam(liveMeeting, Roles.MODERATOR_ROLE, guest = false, authed = true, CallingWith.WEBRTC, muted = false,
|
||||
talking = false, listenOnly = false)
|
||||
Users2x.add(liveMeeting.users2x, guser)
|
||||
}
|
||||
}
|
||||
|
||||
def createUserVoiceAndCam(liveMeeting: LiveMeeting, role: String, guest: Boolean, authed: Boolean, callingWith: String,
|
||||
|
@ -1,12 +1,8 @@
|
||||
package org.bigbluebutton.core.model.users
|
||||
{
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import org.as3commons.lang.ArrayUtils;
|
||||
import org.as3commons.lang.StringUtils;
|
||||
import org.bigbluebutton.core.model.BreakoutUser;
|
||||
import org.bigbluebutton.main.model.users.BBBUser;
|
||||
import org.bigbluebutton.main.model.users.BreakoutRoom;
|
||||
|
||||
public class Users2x
|
||||
{
|
||||
@ -136,7 +132,13 @@ package org.bigbluebutton.core.model.users
|
||||
|
||||
|
||||
public function getPresenterGroup(): ArrayCollection {
|
||||
return new ArrayCollection(_presenterGroup.toArray());
|
||||
var temp: Array = new Array();
|
||||
for (var i:int = 0; i < _users.length; i++) {
|
||||
var user:User2x = _users.getItemAt(i) as User2x;
|
||||
temp.push(user.intId);
|
||||
}
|
||||
|
||||
return new ArrayCollection(temp);
|
||||
}
|
||||
|
||||
public function addToPresenterGroup(userId: String):void {
|
||||
|
@ -19,8 +19,6 @@
|
||||
package org.bigbluebutton.main.events
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.main.model.User;
|
||||
|
||||
public class UserJoinedEvent extends Event
|
||||
{
|
||||
|
@ -49,9 +49,6 @@ 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.main.model.users.events.RequestPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.users.events.MeetingMutedEvent;
|
||||
import org.bigbluebutton.modules.users.services.MessageReceiver;
|
||||
import org.bigbluebutton.modules.users.services.MessageSender;
|
||||
@ -273,18 +270,6 @@ 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 handleRequestPresenterGroupEvent(e: RequestPresenterGroupEvent): void {
|
||||
sender.handleRequestPresenterGroupEvent();
|
||||
}
|
||||
|
||||
public function changeRole(e:ChangeRoleEvent):void {
|
||||
if (this.isModerator()) sender.changeRole(e.userid, e.role);
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* 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, bubbles:Boolean, cancelable:Boolean) {
|
||||
super(type, bubbles, cancelable);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -19,18 +19,14 @@
|
||||
package org.bigbluebutton.modules.present.managers
|
||||
{
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.Point;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.core.FlexGlobals;
|
||||
|
||||
import org.bigbluebutton.common.events.CloseWindowEvent;
|
||||
import org.bigbluebutton.common.events.OpenWindowEvent;
|
||||
import org.bigbluebutton.core.Options;
|
||||
import org.bigbluebutton.core.PopUpUtil;
|
||||
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.present.events.DownloadEvent;
|
||||
import org.bigbluebutton.modules.present.events.ExportEvent;
|
||||
import org.bigbluebutton.modules.present.events.GetAllPodsRespEvent;
|
||||
|
@ -25,7 +25,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
import org.bigbluebutton.main.events.BBBEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
|
||||
import org.bigbluebutton.modules.present.business.PresentProxy;
|
||||
import org.bigbluebutton.modules.present.commands.ChangePageCommand;
|
||||
import org.bigbluebutton.modules.present.commands.ChangePresentationCommand;
|
||||
@ -63,7 +62,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<EventHandlers type="{PresentModuleEvent.START_MODULE}" >
|
||||
<MethodInvoker generator="{PresentManager}" method="handleStartModuleEvent" arguments="{event}"/>
|
||||
<MethodInvoker generator="{PresentProxy}" method="getPresentationPodsInfo" />
|
||||
<EventAnnouncer generator="{RequestPresenterGroupEvent}" type="{RequestPresenterGroupEvent.REQUEST_PRESENTER_GROUP}" />
|
||||
<MethodInvoker generator="{PresentProxy}" method="connect" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
|
@ -60,8 +60,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<mate:Listener type="{PollStoppedEvent.POLL_STOPPED}" method="pollStoppedHandler" />
|
||||
<mate:Listener type="{PollShowResultEvent.SHOW_RESULT}" method="pollShowResultHandler" />
|
||||
<mate:Listener type="{GoToPageLocalCommand.GO_TO_PAGE_LOCAL}" method="handleGoToPageLocalCommand" />
|
||||
<mate:Listener type="{UserAddedToPresenterGroupEvent.USER_ADDED_TO_PRESENTER_GROUP}" method="handleUserAddedToPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserRemovedFromPresenterGroupEvent.USER_REMOVED_FROM_PRESENTER_GROUP}" method="handleUserRemovedFromPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserJoinedEvent.JOINED}" method="handleUserAddedToPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserLeftEvent.LEFT}" method="handleUserRemovedFromPresenterGroupEvent" />
|
||||
<mate:Listener type="{SetPresenterInPodRespEvent.SET_PRESENTER_IN_POD_RESP}" method="handleSetPresenterInPodRespEvent" />
|
||||
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="onChangeMyRole" />
|
||||
<mate:Listener type="{EventConstants.PRESENTATION_PODS_COUNT_UPDATE}" method="updatesOnPresentationPods" />
|
||||
@ -99,9 +99,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
import org.bigbluebutton.core.model.LiveMeeting;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
import org.bigbluebutton.main.events.UserJoinedEvent;
|
||||
import org.bigbluebutton.main.events.UserLeftEvent;
|
||||
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
|
||||
import org.bigbluebutton.main.model.users.events.UserAddedToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.UserRemovedFromPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.views.MainCanvas;
|
||||
import org.bigbluebutton.modules.polling.events.PollShowResultEvent;
|
||||
import org.bigbluebutton.modules.polling.events.PollStartedEvent;
|
||||
@ -131,7 +131,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.modules.present.model.PresentationPodManager;
|
||||
import org.bigbluebutton.modules.whiteboard.events.RequestNewCanvasEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.views.IWhiteboardOverlay;
|
||||
import org.bigbluebutton.modules.whiteboard.views.IWhiteboardReceiver;
|
||||
import org.bigbluebutton.modules.whiteboard.views.IWhiteboardToolbar;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
|
||||
@ -223,31 +222,28 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
podDropdownVisible = (e.role == Role.MODERATOR);
|
||||
}
|
||||
|
||||
private function handleUserAddedToPresenterGroupEvent(event: UserAddedToPresenterGroupEvent): void {
|
||||
private function handleUserAddedToPresenterGroupEvent(event: UserJoinedEvent): void {
|
||||
populatePodDropdown();
|
||||
|
||||
}
|
||||
|
||||
private function handleUserRemovedFromPresenterGroupEvent(event: UserRemovedFromPresenterGroupEvent): void {
|
||||
private function handleUserRemovedFromPresenterGroupEvent(event: UserLeftEvent): void {
|
||||
populatePodDropdown();
|
||||
}
|
||||
|
||||
private function populatePodDropdown():void {
|
||||
this.currentPresenterUsername = UsersUtil.getUserName(this.currentPresenterInPod);
|
||||
dispatchEvent(new Event('titleChanged'));
|
||||
|
||||
|
||||
listOfPodControls = [];
|
||||
|
||||
listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen'), type: "action", handler: newPresentationWindowHandler});
|
||||
|
||||
if (this.podId != PresentationPodManager.DEFAULT_POD_ID) {
|
||||
listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.closePresentationWindowOpen'), type: "action", handler: closePresentationWindowHandler});
|
||||
}
|
||||
|
||||
var presGroup:Array = ArrayUtils.getUniqueValues(UsersUtil.getPresenterGroup().source);
|
||||
if (presGroup.length > 0 || !StringUtils.isEmpty(currentPresenterUsername)) {
|
||||
listOfPodControls.push({type: "separator", label: StringUtil.repeat("─", Math.floor(ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen').length / 2) + 2)});
|
||||
listOfPodControls.push({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.itemrenderer.presenter'), type: "title", styleName: "podItemTitle"});
|
||||
|
||||
for (var j:int = 0; j < presGroup.length; j++) {
|
||||
var nextPresenterId:String = presGroup[j] as String;
|
||||
var userName:String = UsersUtil.getUserName(nextPresenterId);
|
||||
@ -374,8 +370,46 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
becomeViewer();
|
||||
}
|
||||
setPollMenuData();
|
||||
|
||||
}
|
||||
|
||||
private function populatePresenterGroupDropDown():void {
|
||||
listOfPodControls.addItem({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen'), type: "action", handler: newPresentationWindowHandler});
|
||||
|
||||
if (this.podId != PresentationPodManager.DEFAULT_POD_ID) {
|
||||
listOfPodControls.addItem({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.closePresentationWindowOpen'), type: "action", handler: closePresentationWindowHandler});
|
||||
}
|
||||
|
||||
listOfPodControls.addItem({type: "separator", label: StringUtil.repeat("─", Math.floor(ResourceUtil.getInstance().getString('bbb.presentation.multipod.controls.newPresentationWindowOpen').length / 2) + 2)});
|
||||
listOfPodControls.addItem({label: ResourceUtil.getInstance().getString('bbb.presentation.multipod.itemrenderer.presenter'), type: "title", styleName: "podItemTitle"});
|
||||
|
||||
var presGroup:Array = ArrayUtils.getUniqueValues(UsersUtil.getPresenterGroup().source);
|
||||
for (var j:int = 0; j < presGroup.length; j++) {
|
||||
var nextPresenterId:String = presGroup[j] as String;
|
||||
var userName:String = UsersUtil.getUserName(nextPresenterId);
|
||||
var myUser:Boolean = LiveMeeting.inst().me.id == nextPresenterId;
|
||||
if (nextPresenterId == this.currentPresenterInPod) {
|
||||
userName = "✓ " + userName;
|
||||
}
|
||||
if (myUser) {
|
||||
userName += ' (' + ResourceUtil.getInstance().getString('bbb.users.usersGrid.nameItemRenderer.youIdentifier') + ')'
|
||||
}
|
||||
if (!StringUtils.isEmpty(UsersUtil.getUserName(nextPresenterId))) { // avoid duplication
|
||||
listOfPodControls.addItem({label: userName, type: "user", handler: requestPodPresenterChange, data: nextPresenterId, styleName: myUser ? "podCurrentUser" : ""});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add Fake presenters to test limits of dropdown
|
||||
/**
|
||||
for (var jk:int = 0; jk < 100; jk++) {
|
||||
var tempUsername: String = "FOO " + jk;
|
||||
var tempPresId: String = "foo_" + jk;
|
||||
listOfPodControls.addItem({label: tempUsername, type: "user", handler: requestPodPresenterChange, data: nextPresenterId, styleName: false ? "podCurrentUser" : ""});
|
||||
}
|
||||
* **/
|
||||
}
|
||||
|
||||
private function requestWhiteboardCanvas(event:TimerEvent):void {
|
||||
LOGGER.debug("Sending event to add whiteboard canvas.");
|
||||
callLater(fitSlideToWindowMaintainingAspectRatio);
|
||||
|
@ -36,15 +36,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.main.events.UserServicesEvent;
|
||||
import org.bigbluebutton.main.model.GuestManager;
|
||||
import org.bigbluebutton.main.model.users.UserService;
|
||||
import org.bigbluebutton.main.model.users.events.AddUserToPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.BroadcastStoppedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
|
||||
import org.bigbluebutton.main.model.users.events.ChangeRoleEvent;
|
||||
import org.bigbluebutton.main.model.users.events.EmojiStatusEvent;
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RemoveUserFromPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RequestPresenterGroupEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
|
||||
<!--TODO: Move guest events to user events? -->
|
||||
|
||||
@ -108,18 +105,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<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="{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>
|
||||
|
@ -42,7 +42,6 @@ package org.bigbluebutton.modules.users.services
|
||||
import org.bigbluebutton.core.vo.LockSettingsVO;
|
||||
import org.bigbluebutton.main.events.BBBEvent;
|
||||
import org.bigbluebutton.main.events.BreakoutRoomEvent;
|
||||
import org.bigbluebutton.main.events.LogoutEvent;
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
|
||||
import org.bigbluebutton.main.events.UserJoinedEvent;
|
||||
@ -52,8 +51,6 @@ 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.phone.events.AudioSelectionWindowEvent;
|
||||
import org.bigbluebutton.modules.screenshare.events.WebRTCViewStreamEvent;
|
||||
import org.bigbluebutton.modules.users.events.MeetingMutedEvent;
|
||||
@ -200,15 +197,6 @@ package org.bigbluebutton.modules.users.services
|
||||
case "GetGuestsWaitingApprovalRespMsg":
|
||||
handleGetGuestsWaitingApprovalRespMsg(message);
|
||||
break;
|
||||
case "UserAddedToPresenterGroupEvtMsg":
|
||||
handleUserAddedToPresenterGroupEvtMsg(message);
|
||||
break;
|
||||
case "UserRemovedFromPresenterGroupEvtMsg":
|
||||
handleUserRemovedFromPresenterGroupEvtMsg(message);
|
||||
break;
|
||||
case "GetPresenterGroupRespMsg":
|
||||
handleGetPresenterGroupRespMsg(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -883,24 +871,6 @@ package org.bigbluebutton.modules.users.services
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -51,8 +51,6 @@
|
||||
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;
|
||||
@ -154,14 +152,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@ -339,20 +329,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (UsersUtil.isUserInPresentationGroup(data.userId)) {
|
||||
myMenuData.push({
|
||||
label: ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.removeUserFromPresenterGroup',[data.name]),
|
||||
icon: getStyle('iconEject'),
|
||||
callback: removeFromPresenterGroup
|
||||
});
|
||||
} else {
|
||||
myMenuData.push({
|
||||
label: ResourceUtil.getInstance().getString('bbb.users.usersGrid.mediaItemRenderer.addUserToPresenterGroup',[data.name]),
|
||||
icon: getStyle('iconEject'),
|
||||
callback: addToPresenterGroup
|
||||
});
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
@ -51,8 +51,6 @@ $Id: $
|
||||
<mate:Listener type="{BBBEvent.USER_VOICE_MUTED}" method="handleUserMutedEvent" />
|
||||
<mate:Listener type="{EventConstants.USER_TALKING}" method="handleUserTalkingEvent" />
|
||||
<mate:Listener type="{UserLeftEvent.LEFT}" method="handleUserLeftEvent" />
|
||||
<mate:Listener type="{UserAddedToPresenterGroupEvent.USER_ADDED_TO_PRESENTER_GROUP}" method="handleUserAddedToPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserRemovedFromPresenterGroupEvent.USER_REMOVED_FROM_PRESENTER_GROUP}" method="handleUserRemovedFromPresenterGroupEvent" />
|
||||
<mate:Listener type="{UserEmojiChangedEvent.USER_EMOJI_CHANGED}" method="handleUserEmojiChangedEvent" />
|
||||
<mate:Listener type="{SwitchedPresenterEvent.SWITCHED_PRESENTER}" method="handleSwitchedPresenterEvent" />
|
||||
<mate:Listener type="{StoppedViewingWebcamEvent.STOPPED_VIEWING_WEBCAM}" method="handleStoppedViewingWebcamEvent" />
|
||||
@ -120,8 +118,6 @@ $Id: $
|
||||
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
|
||||
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.main.views.GuestSettingsWindow;
|
||||
import org.bigbluebutton.main.views.MainCanvas;
|
||||
import org.bigbluebutton.main.views.PendingGuestsWindow;
|
||||
@ -221,14 +217,6 @@ $Id: $
|
||||
handler.handleUserLeftEvent(event.userID);
|
||||
}
|
||||
|
||||
private function handleUserAddedToPresenterGroupEvent(event: UserAddedToPresenterGroupEvent): void {
|
||||
LiveMeeting.inst().users.addToPresenterGroup(event.userId);
|
||||
}
|
||||
|
||||
private function handleUserRemovedFromPresenterGroupEvent(event: UserRemovedFromPresenterGroupEvent): void {
|
||||
LiveMeeting.inst().users.removeFromPresenterGroup(event.userId);
|
||||
}
|
||||
|
||||
private function handleStoppedViewingWebcamEvent(event: StoppedViewingWebcamEvent): void {
|
||||
handler.handleStoppedViewingWebcamEvent(event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user