Skip to content

Commit

Permalink
Merge pull request #11390 from aron-2809/fix-userId-EndMeeting
Browse files Browse the repository at this point in the history
fix inserts userId to the EndMeeting function calls.
  • Loading branch information
ritzalam committed Feb 12, 2021
2 parents 188c406 + 1d8c51e commit 04a05f0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers {

def handleEndBreakoutRoomInternalMsg(msg: EndBreakoutRoomInternalMsg): Unit = {
log.info("Breakout room {} ended by parent meeting {}.", msg.breakoutId, msg.parentId)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_BY_PARENT, eventBus, outGW, liveMeeting)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_BY_PARENT, eventBus, outGW, liveMeeting, "system")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait LogoutAndEndMeetingCmdMsgHdlr extends RightsManagementTrait {
endAllBreakoutRooms(eventBus, liveMeeting, state)
log.info("Meeting {} ended by user [{}, {}} when logging out.", liveMeeting.props.meetingProp.intId,
u.intId, u.name)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_AFTER_USER_LOGGED_OUT, eventBus, outGW, liveMeeting)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_AFTER_USER_LOGGED_OUT, eventBus, outGW, liveMeeting, u.intId)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,18 @@ trait HandlerHelpers extends SystemConfiguration {
newState
}

def endMeeting(outGW: OutMsgRouter, liveMeeting: LiveMeeting, reason: String): Unit = {
def buildMeetingEndingEvtMsg(meetingId: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, "not-used")
def endMeeting(outGW: OutMsgRouter, liveMeeting: LiveMeeting, reason: String, userId: String): Unit = {
def buildMeetingEndingEvtMsg(meetingId: String, userId: String): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId)
val envelope = BbbCoreEnvelope(MeetingEndingEvtMsg.NAME, routing)
val body = MeetingEndingEvtMsgBody(meetingId, reason)
val header = BbbClientMsgHeader(MeetingEndingEvtMsg.NAME, meetingId, "not-used")
val header = BbbClientMsgHeader(MeetingEndingEvtMsg.NAME, meetingId, userId)
val event = MeetingEndingEvtMsg(header, body)

BbbCommonEnvCoreMsg(envelope, event)
}

val endingEvent = buildMeetingEndingEvtMsg(liveMeeting.props.meetingProp.intId)
val endingEvent = buildMeetingEndingEvtMsg(liveMeeting.props.meetingProp.intId, userId)

// Broadcast users the meeting will end
outGW.send(endingEvent)
Expand Down Expand Up @@ -217,8 +217,8 @@ trait HandlerHelpers extends SystemConfiguration {
state.update(None)
}

def sendEndMeetingDueToExpiry(reason: String, eventBus: InternalEventBus, outGW: OutMsgRouter, liveMeeting: LiveMeeting): Unit = {
endMeeting(outGW, liveMeeting, reason)
def sendEndMeetingDueToExpiry(reason: String, eventBus: InternalEventBus, outGW: OutMsgRouter, liveMeeting: LiveMeeting, userId: String): Unit = {
endMeeting(outGW, liveMeeting, reason, userId)
notifyParentThatBreakoutEnded(eventBus, liveMeeting)
ejectAllUsersFromVoiceConf(outGW, liveMeeting)
destroyMeeting(eventBus, liveMeeting.props.meetingProp.intId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ class MeetingActor(
if (authedUsers.isEmpty) {
sendEndMeetingDueToExpiry(
MeetingEndReason.ENDED_DUE_TO_NO_AUTHED_USER,
eventBus, outGW, liveMeeting
eventBus, outGW, liveMeeting,
"system"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait MeetingExpiryTrackerHelper extends HandlerHelpers {
expireReason <- reason
} yield {
endAllBreakoutRooms(eventBus, liveMeeting, state)
sendEndMeetingDueToExpiry(expireReason, eventBus, outGW, liveMeeting)
sendEndMeetingDueToExpiry(expireReason, eventBus, outGW, liveMeeting, "system")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trait EndMeetingSysCmdMsgHdlr extends HandlerHelpers {
def handleEndMeeting(msg: EndMeetingSysCmdMsg, state: MeetingState2x): Unit = {
endAllBreakoutRooms(eventBus, liveMeeting, state)
log.info("Meeting {} ended by from API.", msg.body.meetingId)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_FROM_API, eventBus, outGW, liveMeeting)
sendEndMeetingDueToExpiry(MeetingEndReason.ENDED_FROM_API, eventBus, outGW, liveMeeting, "system")
}

}

0 comments on commit 04a05f0

Please sign in to comment.