switch connId to userId for red5 system messages

This commit is contained in:
Anton Georgiev 2017-07-11 16:19:48 -04:00
parent f6ef0ddf75
commit 422f930bb8
3 changed files with 4 additions and 19 deletions

View File

@ -46,14 +46,14 @@ class MsgToClientJsonActor(msgToClientGW: MsgToClientGW) extends Actor with Acto
def handleSystemMsg(msg: SystemMsgToClient): Unit = {
println("Received SystemMsgToClient " + msg)
val meetingId = msg.meetingId
val connId = msg.connId
val userId = msg.userId
msg.data.envelope.name match {
case DisconnectAllClientsSysMsg.NAME =>
val disconnect = new DisconnectAllClientsMessage(meetingId)
msgToClientGW.systemMessage(disconnect)
case DisconnectClientSysMsg.NAME =>
val disconnect = new DisconnectClientMessage(meetingId, connId)
val disconnect = new DisconnectClientMessage(meetingId, userId)
msgToClientGW.systemMessage(disconnect)
}
}

View File

@ -7,7 +7,7 @@ import org.bigbluebutton.common2.msgs.BbbCommonEnvJsNodeMsg
sealed trait ToConnectionMsg
case class BroadcastMsgToMeeting(meetingId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class DirectMsgToClient(meetingId: String, connId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class SystemMsgToClient(meetingId: String, connId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class SystemMsgToClient(meetingId: String, userId: String, data: BbbCommonEnvJsNodeMsg) extends ToConnectionMsg
case class MsgToClientBusMsg(val topic: String, payload: ToConnectionMsg)

View File

@ -147,26 +147,11 @@ class UserActor(val userId: String,
}
def handleSystemMessage(msg: BbbCommonEnvJsNodeMsg): Unit = {
for {
conn <- Connections.findActiveConnection(conns)
} yield {
// val json = JsonUtil.toJson(msg.core)
msg.envelope.name match {
case DisconnectClientSysMsg.NAME => handleDisconnectClientSysMsg(msg)
case _ => {
msgToClientEventBus.publish(MsgToClientBusMsg(toClientChannel, SystemMsgToClient(meetingId, conn.connId, msg)))
}
}
}
}
def handleDisconnectClientSysMsg(msg: BbbCommonEnvJsNodeMsg): Unit = {
for {
userId <- msg.envelope.routing.get("userId")
} yield {
// Note - we use userId rather than connId for DisconnectClientSysMsg
msgToClientEventBus.publish(MsgToClientBusMsg(toClientChannel, SystemMsgToClient(meetingId, userId, msg)))
}
}
}