- delay removing user from user's list in case the user is just reconnecting
This commit is contained in:
parent
eafa3273c5
commit
92a2cd0d60
@ -4,6 +4,7 @@ import org.bigbluebutton.common2.msgs.UserJoinMeetingAfterReconnectReqMsg
|
||||
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
|
||||
import org.bigbluebutton.core.apps.voice.UserJoinedVoiceConfEvtMsgHdlr
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.models.Users2x
|
||||
import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting, OutMsgRouter }
|
||||
|
||||
trait UserJoinMeetingAfterReconnectReqMsgHdlr extends HandlerHelpers with BreakoutHdlrHelpers with UserJoinedVoiceConfEvtMsgHdlr {
|
||||
@ -13,14 +14,24 @@ trait UserJoinMeetingAfterReconnectReqMsgHdlr extends HandlerHelpers with Breako
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleUserJoinMeetingAfterReconnectReqMsg(msg: UserJoinMeetingAfterReconnectReqMsg, state: MeetingState2x): MeetingState2x = {
|
||||
log.info("Received user joined after reconnecting. user " + msg.body.userId + " meetingId=" + msg.header.meetingId)
|
||||
|
||||
Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) match {
|
||||
case Some(reconnectingUser) =>
|
||||
if (reconnectingUser.userLeftFlag.left) {
|
||||
log.info("Resetting flag that user left meeting. user " + msg.body.userId)
|
||||
// User has reconnected. Just reset it's flag. ralam Oct 23, 2018
|
||||
Users2x.resetUserLeftFlag(liveMeeting.users2x, msg.body.userId)
|
||||
}
|
||||
state
|
||||
case None =>
|
||||
val newState = userJoinMeeting(outGW, msg.body.authToken, msg.body.clientType, liveMeeting, state)
|
||||
if (liveMeeting.props.meetingProp.isBreakout) {
|
||||
updateParentMeetingWithUsers()
|
||||
}
|
||||
|
||||
newState
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps.users
|
||||
|
||||
import org.bigbluebutton.common2.msgs.UserJoinMeetingReqMsg
|
||||
import org.bigbluebutton.core.apps.breakout.BreakoutHdlrHelpers
|
||||
import org.bigbluebutton.core.models.VoiceUsers
|
||||
import org.bigbluebutton.core.models.{ Users2x, VoiceUsers }
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.running.{ BaseMeetingActor, HandlerHelpers, LiveMeeting, OutMsgRouter }
|
||||
|
||||
@ -13,6 +13,17 @@ trait UserJoinMeetingReqMsgHdlr extends HandlerHelpers with BreakoutHdlrHelpers
|
||||
val outGW: OutMsgRouter
|
||||
|
||||
def handleUserJoinMeetingReqMsg(msg: UserJoinMeetingReqMsg, state: MeetingState2x): MeetingState2x = {
|
||||
log.info("Received user joined meeting. user " + msg.body.userId + " meetingId=" + msg.header.meetingId)
|
||||
|
||||
Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) match {
|
||||
case Some(reconnectingUser) =>
|
||||
if (reconnectingUser.userLeftFlag.left) {
|
||||
log.info("Resetting flag that user left meeting. user " + msg.body.userId)
|
||||
// User has reconnected. Just reset it's flag. ralam Oct 23, 2018
|
||||
Users2x.resetUserLeftFlag(liveMeeting.users2x, msg.body.userId)
|
||||
}
|
||||
state
|
||||
case None =>
|
||||
val newState = userJoinMeeting(outGW, msg.body.authToken, msg.body.clientType, liveMeeting, state)
|
||||
|
||||
if (liveMeeting.props.meetingProp.isBreakout) {
|
||||
@ -24,6 +35,6 @@ trait UserJoinMeetingReqMsgHdlr extends HandlerHelpers with BreakoutHdlrHelpers
|
||||
|
||||
newState
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,9 @@ trait UserLeaveReqMsgHdlr {
|
||||
def handleUserLeaveReqMsg(msg: UserLeaveReqMsg, state: MeetingState2x): MeetingState2x = {
|
||||
Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) match {
|
||||
case Some(reconnectingUser) =>
|
||||
log.info("Received user left meeting. user " + msg.body.userId + " meetingId=" + msg.header.meetingId)
|
||||
if (!reconnectingUser.userLeftFlag.left) {
|
||||
log.info("Setting user left flag. user " + msg.body.userId + " meetingId=" + msg.header.meetingId)
|
||||
// Just flag that user has left as the user might be reconnecting.
|
||||
// An audit will remove this user if it hasn't rejoined after a certain period of time.
|
||||
// ralam oct 23, 2018
|
||||
|
@ -40,7 +40,7 @@ object Users2x {
|
||||
|
||||
def findAllExpiredUserLeftFlags(users: Users2x): Vector[UserState] = {
|
||||
users.toVector filter (u => u.userLeftFlag.left && u.userLeftFlag.leftOn != 0 &&
|
||||
System.currentTimeMillis() - u.userLeftFlag.leftOn > 60000)
|
||||
System.currentTimeMillis() - u.userLeftFlag.leftOn > 10000)
|
||||
}
|
||||
|
||||
def numUsers(users: Users2x): Int = {
|
||||
|
@ -418,7 +418,7 @@ class MeetingActor(
|
||||
for {
|
||||
u <- Users2x.remove(liveMeeting.users2x, leftUser.intId)
|
||||
} yield {
|
||||
log.info("User left meeting. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u)
|
||||
log.info("Removing user from meeting. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u)
|
||||
|
||||
captionApp2x.handleUserLeavingMsg(leftUser.intId)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user