- need to notify parent meeting of user join and leave to get listen in to work

This commit is contained in:
Richard Alam 2017-08-04 09:32:52 -07:00
parent b1b00aa070
commit 05054e4875
6 changed files with 47 additions and 20 deletions

View File

@ -2,12 +2,16 @@ package org.bigbluebutton.core.apps.breakout
import org.bigbluebutton.SystemConfiguration
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.models.Users2x
import org.bigbluebutton.core.api.{ BreakoutRoomUsersUpdateInternalMsg, SendBreakoutUsersAuditInternalMsg }
import org.bigbluebutton.core.bus.{ BigBlueButtonEvent, InternalEventBus }
import org.bigbluebutton.core.domain.{ BreakoutUser, BreakoutVoiceUser }
import org.bigbluebutton.core.models.{ Users2x, VoiceUsers }
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter }
trait BreakoutHdlrHelpers extends SystemConfiguration {
val liveMeeting: LiveMeeting
val outGW: OutMsgRouter
val eventBus: InternalEventBus
def sendJoinURL(userId: String, externalMeetingId: String, roomSequence: String, breakoutId: String) {
for {
@ -47,4 +51,19 @@ trait BreakoutHdlrHelpers extends SystemConfiguration {
outGW.send(msgEvent)
}
def updateParentMeetingWithUsers(): Unit = {
val users = Users2x.findAll(liveMeeting.users2x)
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(
liveMeeting.props.breakoutProps.parentId,
new BreakoutRoomUsersUpdateInternalMsg(liveMeeting.props.breakoutProps.parentId, liveMeeting.props.meetingProp.intId,
breakoutUsers, breakoutVoiceUsers)
))
}
}

View File

@ -1,9 +1,6 @@
package org.bigbluebutton.core.apps.breakout
import org.bigbluebutton.core.api.{ BreakoutRoomUsersUpdateInternalMsg, SendBreakoutUsersAuditInternalMsg }
import org.bigbluebutton.core.bus.BigBlueButtonEvent
import org.bigbluebutton.core.domain.{ BreakoutUser, BreakoutVoiceUser }
import org.bigbluebutton.core.models.{ Users2x, VoiceUser2x, VoiceUsers }
import org.bigbluebutton.core.api.{ SendBreakoutUsersAuditInternalMsg }
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
trait SendBreakoutUsersUpdateMsgHdlr {
@ -13,16 +10,6 @@ trait SendBreakoutUsersUpdateMsgHdlr {
def handleSendBreakoutUsersUpdateInternalMsg(msg: SendBreakoutUsersAuditInternalMsg): Unit = {
val users = Users2x.findAll(liveMeeting.users2x)
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(
props.breakoutProps.parentId,
new BreakoutRoomUsersUpdateInternalMsg(props.breakoutProps.parentId, props.meetingProp.intId,
breakoutUsers, breakoutVoiceUsers)
))
updateParentMeetingWithUsers()
}
}

View File

@ -1,17 +1,24 @@
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs.UserJoinMeetingReqMsg
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
import org.bigbluebutton.core.domain.MeetingState2x
import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting, OutMsgRouter }
trait UserJoinMeetingReqMsgHdlr extends HandlerHelpers {
trait UserJoinMeetingReqMsgHdlr extends HandlerHelpers with BreakoutHdlrHelpers {
this: BaseMeetingActor =>
val liveMeeting: LiveMeeting
val outGW: OutMsgRouter
def handleUserJoinMeetingReqMsg(msg: UserJoinMeetingReqMsg, state: MeetingState2x): MeetingState2x = {
userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state)
val newState = userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state)
if (liveMeeting.props.meetingProp.isBreakout) {
updateParentMeetingWithUsers()
}
newState
}
}

View File

@ -57,6 +57,10 @@ trait UserLeaveReqMsgHdlr {
}
}
if (liveMeeting.props.meetingProp.isBreakout) {
updateParentMeetingWithUsers()
}
if (Users2x.numUsers(liveMeeting.users2x) == 0) {
val tracker = state.expiryTracker.setLastUserLeftOn(TimeUtil.timeNowInMs())
state.update(tracker)

View File

@ -1,11 +1,12 @@
package org.bigbluebutton.core.apps.voice
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
import org.bigbluebutton.core.models.{ VoiceUser2x, VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting, OutMsgRouter }
import org.bigbluebutton.core2.MeetingStatus2x
trait UserJoinedVoiceConfEvtMsgHdlr {
trait UserJoinedVoiceConfEvtMsgHdlr extends BreakoutHdlrHelpers {
this: BaseMeetingActor =>
val liveMeeting: LiveMeeting
@ -44,6 +45,10 @@ trait UserJoinedVoiceConfEvtMsgHdlr {
broadcastEvent(voiceUserState)
if (liveMeeting.props.meetingProp.isBreakout) {
updateParentMeetingWithUsers()
}
startRecordingVoiceConference()
}

View File

@ -1,11 +1,12 @@
package org.bigbluebutton.core.apps.voice
import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers }
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting, MeetingActor, OutMsgRouter }
import org.bigbluebutton.core2.MeetingStatus2x
trait UserLeftVoiceConfEvtMsgHdlr {
trait UserLeftVoiceConfEvtMsgHdlr extends BreakoutHdlrHelpers {
this: BaseMeetingActor =>
val liveMeeting: LiveMeeting
@ -33,6 +34,10 @@ trait UserLeftVoiceConfEvtMsgHdlr {
broadcastEvent(user)
}
if (liveMeeting.props.meetingProp.isBreakout) {
updateParentMeetingWithUsers()
}
stopRecordingVoiceConference()
}