Skip to content
Snippets Groups Projects
Commit 422f930b authored by Anton Georgiev's avatar Anton Georgiev
Browse files

switch connId to userId for red5 system messages

parent f6ef0ddf
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
}
......
......@@ -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)
......
......@@ -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)))
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment