- not transfer works but user isn't removed from users list in breakout room

This commit is contained in:
Richard Alam 2017-08-03 15:16:29 -07:00
parent 30503d9c5d
commit 279d3797ef
8 changed files with 50 additions and 17 deletions

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.api package org.bigbluebutton.core.api
import org.bigbluebutton.common2.msgs.BreakoutUserVO import org.bigbluebutton.common2.msgs.BreakoutUserVO
import org.bigbluebutton.core.domain.BreakoutUser import org.bigbluebutton.core.domain.{ BreakoutUser, BreakoutVoiceUser }
import spray.json.JsObject import spray.json.JsObject
case class InMessageHeader(name: String) case class InMessageHeader(name: String)
case class InHeaderAndJsonPayload(header: InMessageHeader, payload: JsObject) case class InHeaderAndJsonPayload(header: InMessageHeader, payload: JsObject)
@ -58,7 +58,9 @@ case class SendBreakoutUsersAuditInternalMsg(parentId: String, breakoutId: Strin
* @param breakoutId * @param breakoutId
* @param users * @param users
*/ */
case class BreakoutRoomUsersUpdateInternalMsg(parentId: String, breakoutId: String, users: Vector[BreakoutUser]) extends InMessage case class BreakoutRoomUsersUpdateInternalMsg(parentId: String, breakoutId: String,
users: Vector[BreakoutUser],
voiceUsers: Vector[BreakoutVoiceUser]) extends InMessage
/** /**
* Sent by parent meeting to breakout room to end breakout room. * Sent by parent meeting to breakout room to end breakout room.

View File

@ -12,7 +12,7 @@ object BreakoutModel {
voiceConf: String, voiceConf: String,
assignedUsers: Vector[String] assignedUsers: Vector[String]
): BreakoutRoom2x = { ): BreakoutRoom2x = {
new BreakoutRoom2x(id, externalId, name, parentId, sequence, voiceConf, assignedUsers, Vector(), None, false) new BreakoutRoom2x(id, externalId, name, parentId, sequence, voiceConf, assignedUsers, Vector(), Vector(), None, false)
} }
} }

View File

@ -27,7 +27,7 @@ trait BreakoutRoomUsersUpdateMsgHdlr {
model <- state.breakout model <- state.breakout
room <- model.find(msg.breakoutId) room <- model.find(msg.breakoutId)
} yield { } yield {
val updatedRoom = room.copy(users = msg.users) val updatedRoom = room.copy(users = msg.users, voiceUsers = msg.voiceUsers)
val msgEvent = broadcastEvent(updatedRoom) val msgEvent = broadcastEvent(updatedRoom)
outGW.send(msgEvent) outGW.send(msgEvent)
model.update(updatedRoom) model.update(updatedRoom)

View File

@ -2,8 +2,8 @@ package org.bigbluebutton.core.apps.breakout
import org.bigbluebutton.core.api.{ BreakoutRoomUsersUpdateInternalMsg, SendBreakoutUsersAuditInternalMsg } import org.bigbluebutton.core.api.{ BreakoutRoomUsersUpdateInternalMsg, SendBreakoutUsersAuditInternalMsg }
import org.bigbluebutton.core.bus.BigBlueButtonEvent import org.bigbluebutton.core.bus.BigBlueButtonEvent
import org.bigbluebutton.core.domain.BreakoutUser import org.bigbluebutton.core.domain.{ BreakoutUser, BreakoutVoiceUser }
import org.bigbluebutton.core.models.Users2x import org.bigbluebutton.core.models.{ Users2x, VoiceUser2x, VoiceUsers }
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter } import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
trait SendBreakoutUsersUpdateMsgHdlr { trait SendBreakoutUsersUpdateMsgHdlr {
@ -16,9 +16,13 @@ trait SendBreakoutUsersUpdateMsgHdlr {
val users = Users2x.findAll(liveMeeting.users2x) val users = Users2x.findAll(liveMeeting.users2x)
val breakoutUsers = users map { u => new BreakoutUser(u.extId, u.name) } val breakoutUsers = users map { u => new BreakoutUser(u.extId, u.name) }
val voiceUsers = VoiceUsers.findAll(liveMeeting.voiceUsers)
val breakoutVoiceUsers = voiceUsers map { vu => BreakoutVoiceUser(vu.intId, vu.intId, vu.voiceUserId) }
eventBus.publish(BigBlueButtonEvent( eventBus.publish(BigBlueButtonEvent(
props.breakoutProps.parentId, props.breakoutProps.parentId,
new BreakoutRoomUsersUpdateInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId, breakoutUsers) new BreakoutRoomUsersUpdateInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId,
breakoutUsers, breakoutVoiceUsers)
)) ))
} }
} }

View File

@ -13,14 +13,38 @@ trait TransferUserToMeetingRequestHdlr {
def handleTransferUserToMeetingRequestMsg(msg: TransferUserToMeetingRequestMsg, state: MeetingState2x): MeetingState2x = { def handleTransferUserToMeetingRequestMsg(msg: TransferUserToMeetingRequestMsg, state: MeetingState2x): MeetingState2x = {
for { if (msg.body.fromMeetingId == liveMeeting.props.meetingProp.intId) {
model <- state.breakout // want to transfer from parent meeting to breakout
to <- getVoiceConf(msg.body.toMeetingId, model) for {
from <- getVoiceConf(msg.body.fromMeetingId, model) model <- state.breakout
voiceUser <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId) to <- getVoiceConf(msg.body.toMeetingId, model)
} yield { from <- getVoiceConf(msg.body.fromMeetingId, model)
val event = buildTransferUserToVoiceConfSysMsg(from, to, voiceUser.voiceUserId) voiceUser <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId)
outGW.send(event) } yield {
val event = buildTransferUserToVoiceConfSysMsg(from, to, voiceUser.voiceUserId)
outGW.send(event)
}
} else {
for {
model <- state.breakout
room <- model.find(msg.body.fromMeetingId)
} yield {
room.voiceUsers.foreach { vu =>
log.info(" ***** Breakout voice user={} userId={}", vu, msg.body.userId)
}
}
for {
model <- state.breakout
to <- getVoiceConf(msg.body.toMeetingId, model)
from <- getVoiceConf(msg.body.fromMeetingId, model)
room <- model.find(msg.body.fromMeetingId)
voiceUser <- room.voiceUsers.find(p => p.id == msg.body.userId)
} yield {
val event = buildTransferUserToVoiceConfSysMsg(from, to, voiceUser.voiceUserId)
outGW.send(event)
}
} }
state state

View File

@ -9,6 +9,7 @@ case class BreakoutRoom2x(
voiceConf: String, voiceConf: String,
assignedUsers: Vector[String], assignedUsers: Vector[String],
users: Vector[BreakoutUser], users: Vector[BreakoutUser],
voiceUsers: Vector[BreakoutVoiceUser],
startedOn: Option[Long], startedOn: Option[Long],
started: Boolean started: Boolean
) { ) {
@ -16,3 +17,4 @@ case class BreakoutRoom2x(
} }
case class BreakoutUser(id: String, name: String) case class BreakoutUser(id: String, name: String)
case class BreakoutVoiceUser(id: String, extId: String, voiceUserId: String)

View File

@ -66,6 +66,7 @@ class AnalyticsActor extends Actor with ActorLogging {
case m: ScreenshareRtmpBroadcastStoppedEvtMsg => logMessage(msg) case m: ScreenshareRtmpBroadcastStoppedEvtMsg => logMessage(msg)
case m: MeetingInactivityWarningEvtMsg => logMessage(msg) case m: MeetingInactivityWarningEvtMsg => logMessage(msg)
case m: StartRecordingVoiceConfSysMsg => logMessage(msg) case m: StartRecordingVoiceConfSysMsg => logMessage(msg)
case m: TransferUserToVoiceConfSysMsg => logMessage(msg)
case _ => // ignore message case _ => // ignore message
} }
} }

View File

@ -143,11 +143,11 @@ package org.bigbluebutton.modules.users.services
}, JSON.stringify(message)); }, JSON.stringify(message));
} }
public function listenInOnBreakout(fomMeetingId:String, toMeetingId:String, userId:String):void { public function listenInOnBreakout(fromMeetingId:String, toMeetingId:String, userId:String):void {
var message:Object = { var message:Object = {
header: {name: "TransferUserToMeetingRequestMsg", meetingId: UsersUtil.getInternalMeetingID(), header: {name: "TransferUserToMeetingRequestMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()}, userId: UsersUtil.getMyUserID()},
body: {fomMeetingId: fomMeetingId, toMeetingId: toMeetingId, userId: UsersUtil.getMyUserID()} body: {fromMeetingId: fromMeetingId, toMeetingId: toMeetingId, userId: UsersUtil.getMyUserID()}
}; };
var _nc:ConnectionManager = BBB.initConnectionManager(); var _nc:ConnectionManager = BBB.initConnectionManager();