- restructure handlers to make it easier to test
This commit is contained in:
parent
7ff3b9f516
commit
eb9a96348a
@ -1,10 +1,15 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.OutMessageGateway
|
||||
import org.bigbluebutton.core.models.{ UserState, Users2x }
|
||||
import org.bigbluebutton.core.running.LiveMeeting
|
||||
|
||||
trait AssignPresenterReqMsgHdlr {
|
||||
this: UsersApp2x =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
||||
def handleAssignPresenterReqMsg(msg: AssignPresenterReqMsg) {
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.OutMessageGateway
|
||||
import org.bigbluebutton.core.models.{ Roles, Users2x }
|
||||
import org.bigbluebutton.core.running.LiveMeeting
|
||||
|
||||
trait ChangeUserRoleCmdMsgHdlr {
|
||||
this: UsersApp2x =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
||||
def handleChangeUserRoleCmdMsg(msg: ChangeUserRoleCmdMsg) {
|
||||
for {
|
||||
|
@ -7,7 +7,7 @@ import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
import org.bigbluebutton.core2.message.senders.MsgBuilder
|
||||
|
||||
trait EjectUserFromMeetingCmdMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -6,7 +6,7 @@ import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
import org.bigbluebutton.core2.MeetingStatus2x
|
||||
|
||||
trait GetRecordingStatusReqMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -8,7 +8,7 @@ import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
import org.bigbluebutton.core2.MeetingStatus2x
|
||||
|
||||
trait LogoutAndEndMeetingCmdMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -6,7 +6,7 @@ import org.bigbluebutton.core.domain.MeetingInactivityTracker
|
||||
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting, MeetingInactivityTrackerHelper }
|
||||
|
||||
trait MeetingActivityResponseCmdMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -7,7 +7,7 @@ import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
import org.bigbluebutton.core2.MeetingStatus2x
|
||||
|
||||
trait RegisterUserReqMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -6,7 +6,7 @@ import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
import org.bigbluebutton.core2.MeetingStatus2x
|
||||
|
||||
trait SetRecordingStatusCmdMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -6,7 +6,7 @@ import org.bigbluebutton.core.models.Users2x
|
||||
import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting }
|
||||
|
||||
trait SyncGetUsersMeetingRespMsgHdlr {
|
||||
this: BaseMeetingActor =>
|
||||
this: UsersApp =>
|
||||
|
||||
val liveMeeting: LiveMeeting
|
||||
val outGW: OutMessageGateway
|
||||
|
@ -12,7 +12,16 @@ class UsersApp(
|
||||
)(implicit val context: ActorContext)
|
||||
|
||||
extends ValidateAuthTokenReqMsgHdlr
|
||||
with GetUsersMeetingReqMsgHdlr {
|
||||
with GetUsersMeetingReqMsgHdlr
|
||||
with RegisterUserReqMsgHdlr
|
||||
with ChangeUserRoleCmdMsgHdlr
|
||||
with SyncGetUsersMeetingRespMsgHdlr
|
||||
with LogoutAndEndMeetingCmdMsgHdlr
|
||||
with MeetingActivityResponseCmdMsgHdlr
|
||||
with SetRecordingStatusCmdMsgHdlr
|
||||
with GetRecordingStatusReqMsgHdlr
|
||||
with AssignPresenterReqMsgHdlr
|
||||
with EjectUserFromMeetingCmdMsgHdlr {
|
||||
|
||||
val log = Logging(context.system, getClass)
|
||||
}
|
||||
|
@ -4,16 +4,8 @@ import org.bigbluebutton.core.running.MeetingActor
|
||||
import org.bigbluebutton.core2.message.handlers.users.{ ChangeUserEmojiCmdMsgHdlr, ValidateAuthTokenReqMsgHdlr }
|
||||
|
||||
trait UsersApp2x
|
||||
extends RegisterUserReqMsgHdlr
|
||||
with ChangeUserRoleCmdMsgHdlr
|
||||
with SyncGetUsersMeetingRespMsgHdlr
|
||||
with UserLeaveReqMsgHdlr
|
||||
with LogoutAndEndMeetingCmdMsgHdlr
|
||||
with MeetingActivityResponseCmdMsgHdlr
|
||||
with SetRecordingStatusCmdMsgHdlr
|
||||
with GetRecordingStatusReqMsgHdlr
|
||||
with AssignPresenterReqMsgHdlr
|
||||
with EjectUserFromMeetingCmdMsgHdlr
|
||||
extends UserLeaveReqMsgHdlr
|
||||
|
||||
with ChangeUserEmojiCmdMsgHdlr {
|
||||
|
||||
this: MeetingActor =>
|
||||
|
@ -127,7 +127,7 @@ class MeetingActor(
|
||||
|
||||
// Handling RegisterUserReqMsg as it is forwarded from BBBActor and
|
||||
// its type is not BbbCommonEnvCoreMsg
|
||||
case m: RegisterUserReqMsg => handleRegisterUserReqMsg(m)
|
||||
case m: RegisterUserReqMsg => usersApp.handleRegisterUserReqMsg(m)
|
||||
case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m)
|
||||
|
||||
// Meeting
|
||||
@ -165,12 +165,12 @@ class MeetingActor(
|
||||
case m: UserBroadcastCamStartMsg => handleUserBroadcastCamStartMsg(m)
|
||||
case m: UserBroadcastCamStopMsg => handleUserBroadcastCamStopMsg(m)
|
||||
case m: UserJoinedVoiceConfEvtMsg => handleUserJoinedVoiceConfEvtMsg(m)
|
||||
case m: MeetingActivityResponseCmdMsg => inactivityTracker = handleMeetingActivityResponseCmdMsg(m, inactivityTracker)
|
||||
case m: LogoutAndEndMeetingCmdMsg => handleLogoutAndEndMeetingCmdMsg(m)
|
||||
case m: SetRecordingStatusCmdMsg => handleSetRecordingStatusCmdMsg(m)
|
||||
case m: GetRecordingStatusReqMsg => handleGetRecordingStatusReqMsg(m)
|
||||
case m: MeetingActivityResponseCmdMsg => inactivityTracker = usersApp.handleMeetingActivityResponseCmdMsg(m, inactivityTracker)
|
||||
case m: LogoutAndEndMeetingCmdMsg => usersApp.handleLogoutAndEndMeetingCmdMsg(m)
|
||||
case m: SetRecordingStatusCmdMsg => usersApp.handleSetRecordingStatusCmdMsg(m)
|
||||
case m: GetRecordingStatusReqMsg => usersApp.handleGetRecordingStatusReqMsg(m)
|
||||
case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m)
|
||||
case m: EjectUserFromMeetingCmdMsg => handleEjectUserFromMeetingCmdMsg(m)
|
||||
case m: EjectUserFromMeetingCmdMsg => usersApp.handleEjectUserFromMeetingCmdMsg(m)
|
||||
case m: GetUsersMeetingReqMsg => usersApp.handleGetUsersMeetingReqMsg(m)
|
||||
|
||||
// Whiteboard
|
||||
@ -271,7 +271,7 @@ class MeetingActor(
|
||||
handleSyncGetMeetingInfoRespMsg(liveMeeting.props)
|
||||
|
||||
// sync all users
|
||||
handleSyncGetUsersMeetingRespMsg()
|
||||
usersApp.handleSyncGetUsersMeetingRespMsg()
|
||||
|
||||
// sync all presentations
|
||||
presentationApp2x.handleSyncGetPresentationInfoRespMsg()
|
||||
@ -286,7 +286,7 @@ class MeetingActor(
|
||||
handleStopPollReqMsg(msg.header.userId)
|
||||
|
||||
// switch user presenter status for old and new presenter
|
||||
handleAssignPresenterReqMsg(msg)
|
||||
usersApp.handleAssignPresenterReqMsg(msg)
|
||||
|
||||
// TODO stop current screen sharing session (initiated by the old presenter)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user