Skip to content

Commit

Permalink
Merge pull request #8386 from ritzalam/get-meetings-reply
Browse files Browse the repository at this point in the history
Synching of meetings between meteor and akka-apps
  • Loading branch information
antobinary committed Dec 3, 2019
2 parents 8c36a94 + 5d7dbee commit b1b49f8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
Expand Up @@ -74,6 +74,7 @@ class BigBlueButtonActor(
case m: RegisterUserReqMsg => handleRegisterUserReqMsg(m)
case m: EjectDuplicateUserReqMsg => handleEjectDuplicateUserReqMsg(m)
case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m)
case m: GetRunningMeetingsReqMsg => handleGetRunningMeetingsReqMsg(m)
case m: CheckAlivePingSysMsg => handleCheckAlivePingSysMsg(m)
case m: ValidateConnAuthTokenSysMsg => handleValidateConnAuthTokenSysMsg(m)
case _ => log.warning("Cannot handle " + msg.envelope.name)
Expand Down Expand Up @@ -141,7 +142,20 @@ class BigBlueButtonActor(
// do nothing

}
}

private def handleGetRunningMeetingsReqMsg(msg: GetRunningMeetingsReqMsg): Unit = {
val liveMeetings = RunningMeetings.meetings(meetings)
val meetingIds = liveMeetings.map(m => m.props.meetingProp.intId)

val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka")
val envelope = BbbCoreEnvelope(GetRunningMeetingsRespMsg.NAME, routing)
val header = BbbCoreBaseHeader(GetRunningMeetingsRespMsg.NAME)

val body = GetRunningMeetingsRespMsgBody(meetingIds)
val event = GetRunningMeetingsRespMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)
outGW.send(msgEvent)
}

private def handleGetAllMeetingsReqMsg(msg: GetAllMeetingsReqMsg): Unit = {
Expand Down
Expand Up @@ -221,6 +221,7 @@ class MeetingActor(

case m: EjectDuplicateUserReqMsg => usersApp.handleEjectDuplicateUserReqMsg(m)
case m: GetAllMeetingsReqMsg => handleGetAllMeetingsReqMsg(m)
case m: GetRunningMeetingStateReqMsg => handleGetRunningMeetingStateReqMsg(m)
case m: ValidateConnAuthTokenSysMsg => handleValidateConnAuthTokenSysMsg(m)

// Meeting
Expand Down Expand Up @@ -493,7 +494,11 @@ class MeetingActor(
}
}

def handleGetAllMeetingsReqMsg(msg: GetAllMeetingsReqMsg): Unit = {
def handleGetRunningMeetingStateReqMsg(msg: GetRunningMeetingStateReqMsg): Unit = {
processGetRunningMeetingStateReqMsg()
}

def processGetRunningMeetingStateReqMsg(): Unit = {
// sync all meetings
handleSyncGetMeetingInfoRespMsg(liveMeeting.props)

Expand All @@ -513,7 +518,10 @@ class MeetingActor(
handleSyncGetLockSettingsMsg(state, liveMeeting, msgBus)

// TODO send all screen sharing info
}

def handleGetAllMeetingsReqMsg(msg: GetAllMeetingsReqMsg): Unit = {
processGetRunningMeetingStateReqMsg()
}

def handlePresenterChange(msg: AssignPresenterReqMsg, state: MeetingState2x): MeetingState2x = {
Expand Down
Expand Up @@ -31,6 +31,8 @@ class AnalyticsActor extends Actor with ActorLogging {

msg.core match {
case m: GetAllMeetingsReqMsg => logMessage(msg)
case m: GetRunningMeetingsRespMsg => logMessage(msg)
case m: GetRunningMeetingsReqMsg => logMessage(msg)

case m: RegisterUserReqMsg => logMessage(msg)
case m: RegisteredUserJoinTimeoutMsg => logMessage(msg)
Expand Down
Expand Up @@ -37,6 +37,27 @@ case class GetAllMeetingsReqMsg(
) extends BbbCoreMsg
case class GetAllMeetingsReqMsgBody(requesterId: String)

object GetRunningMeetingsReqMsg { val NAME = "GetRunningMeetingsReqMsg" }
case class GetRunningMeetingsReqMsg(
header: BbbCoreBaseHeader,
body: GetRunningMeetingsReqMsgBody
) extends BbbCoreMsg
case class GetRunningMeetingsReqMsgBody(requesterId: String)

object GetRunningMeetingsRespMsg { val NAME = "GetRunningMeetingsRespMsg" }
case class GetRunningMeetingsRespMsg(
header: BbbCoreBaseHeader,
body: GetRunningMeetingsRespMsgBody
) extends BbbCoreMsg
case class GetRunningMeetingsRespMsgBody(meetings: Vector[String])

object GetRunningMeetingStateReqMsg { val NAME = "GetRunningMeetingStateReqMsg" }
case class GetRunningMeetingStateReqMsg(
header: BbbCoreBaseHeader,
body: GetRunningMeetingStateReqMsgBody
) extends BbbCoreMsg
case class GetRunningMeetingStateReqMsgBody(meetingId: String)

object PubSubPingSysReqMsg { val NAME = "PubSubPingSysReqMsg" }
case class PubSubPingSysReqMsg(
header: BbbCoreBaseHeader,
Expand Down

0 comments on commit b1b49f8

Please sign in to comment.