Skip to content

Commit

Permalink
- my IntelliJ IDE seems to format differently with Ghazi's
Browse files Browse the repository at this point in the history
 - fix screenshare redis connection error
 - fix bbb-web create meeting exception when second user joins
  • Loading branch information
ritzalam committed Sep 13, 2018
1 parent 83025a9 commit cc6f88d
Show file tree
Hide file tree
Showing 87 changed files with 491 additions and 617 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ object BigBlueButtonActor extends SystemConfiguration {
system: ActorSystem,
eventBus: InternalEventBus,
bbbMsgBus: BbbMsgRouterEventBus,
outGW: OutMessageGateway
): Props =
outGW: OutMessageGateway): Props =
Props(classOf[BigBlueButtonActor], system, eventBus, bbbMsgBus, outGW)
}

class BigBlueButtonActor(
val system: ActorSystem,
val eventBus: InternalEventBus, val bbbMsgBus: BbbMsgRouterEventBus,
val outGW: OutMessageGateway
) extends Actor
val outGW: OutMessageGateway) extends Actor
with ActorLogging with SystemConfiguration {

implicit def executionContext = system.dispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import org.bigbluebutton.core.bus._

object OutMessageGatewayImp {
def apply(
outBus2: OutEventBus2
) =
outBus2: OutEventBus2) =
new OutMessageGatewayImp(outBus2)
}

class OutMessageGatewayImp(
outBus2: OutEventBus2
) extends OutMessageGateway
outBus2: OutEventBus2) extends OutMessageGateway
with SystemConfiguration {

def send(msg: BbbCommonEnvCoreMsg): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ object BreakoutModel {
sequence: Integer,
freeJoin: Boolean,
voiceConf: String,
assignedUsers: Vector[String]
): BreakoutRoom2x = {
assignedUsers: Vector[String]): BreakoutRoom2x = {
new BreakoutRoom2x(id, externalId, name, parentId, sequence, freeJoin, voiceConf, assignedUsers, Vector(), Vector(), None, false)
}

}

case class BreakoutModel(
startedOn: Option[Long],
durationInMinutes: Int,
rooms: Map[String, BreakoutRoom2x]
) {
startedOn: Option[Long],
durationInMinutes: Int,
rooms: Map[String, BreakoutRoom2x]) {

def find(id: String): Option[BreakoutRoom2x] = {
rooms.get(id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ object BreakoutRoomsUtil {
"isBreakout" -> urlEncode(isBreakout.toString()),
"meetingID" -> urlEncode(breakoutMeetingId),
"password" -> urlEncode(password),
"redirect" -> urlEncode("true")
)
"redirect" -> urlEncode("true"))

(params, params + ("joinViaHtml5" -> urlEncode("true")))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ trait BreakoutHdlrHelpers extends SystemConfiguration {
eventBus.publish(BigBlueButtonEvent(
liveMeeting.props.breakoutProps.parentId,
new BreakoutRoomUsersUpdateInternalMsg(liveMeeting.props.breakoutProps.parentId, liveMeeting.props.meetingProp.intId,
breakoutUsers, breakoutVoiceUsers)
))
breakoutUsers, breakoutVoiceUsers)))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ trait BreakoutRoomCreatedMsgHdlr extends BreakoutHdlrHelpers {
def build(meetingId: String, breakout: BreakoutRoomInfo): BbbCommonEnvCoreMsg = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, "not-used"
)
liveMeeting.props.meetingProp.intId, "not-used")
val envelope = BbbCoreEnvelope(BreakoutRoomStartedEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(BreakoutRoomStartedEvtMsg.NAME, liveMeeting.props.meetingProp.intId, "not-used")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
state.breakout match {
case Some(breakout) =>
log.warning(
"CreateBreakoutRooms event received while breakout created for meeting {}", liveMeeting.props.meetingProp.intId
)
"CreateBreakoutRooms event received while breakout created for meeting {}", liveMeeting.props.meetingProp.intId)
state
case None =>
processRequest(msg, state)
Expand Down Expand Up @@ -60,8 +59,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
msg.body.durationInMinutes,
liveMeeting.props.password.moderatorPass,
liveMeeting.props.password.viewerPass,
presId, presSlide, msg.body.record
)
presId, presSlide, msg.body.record)

val event = buildCreateBreakoutRoomSysCmdMsg(liveMeeting.props.meetingProp.intId, roomDetail)
outGW.send(event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class CaptionApp2x(implicit val context: ActorContext) extends RightsManagementT
def broadcastEvent(msg: EditCaptionHistoryPubMsg): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(EditCaptionHistoryEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(EditCaptionHistoryEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ trait CreateDefaultPublicGroupChat {
val respMsg = buildGroupChatCreatedEvtMsg(
liveMeeting.props.meetingProp.intId,
SystemUser.ID,
groupChat
)
groupChat)

bus.outGW.send(respMsg)
val groupChats = state.groupChats.add(groupChat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ trait GetGroupChatMsgsReqMsgHdlr {
m.sender, m.color, m.message))
val respMsg = buildGetGroupChatMsgsRespMsg(
liveMeeting.props.meetingProp.intId,
msg.header.userId, msgs, gc.id
)
msg.header.userId, msgs, gc.id)
bus.outGW.send(respMsg)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ trait SendGroupChatMessageMsgHdlr {

val event = buildGroupChatMessageBroadcastEvtMsg(
liveMeeting.props.meetingProp.intId,
msg.header.userId, msg.body.chatId, gcm
)
msg.header.userId, msg.body.chatId, gcm)

bus.outGW.send(event)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ trait BroadcastLayoutMsgHdlr extends RightsManagementTrait {
val body = BroadcastLayoutEvtMsgBody(
Layouts.getCurrentLayout(liveMeeting.layouts),
MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout,
Layouts.getLayoutSetter(liveMeeting.layouts), affectedUsers
)
Layouts.getLayoutSetter(liveMeeting.layouts), affectedUsers)
val event = BroadcastLayoutEvtMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ trait GetCurrentLayoutReqMsgHdlr {
val body = GetCurrentLayoutRespMsgBody(
Layouts.getCurrentLayout(liveMeeting.layouts),
MeetingStatus2x.getPermissions(liveMeeting.status).lockedLayout,
Layouts.getLayoutSetter(liveMeeting.layouts)
)
Layouts.getLayoutSetter(liveMeeting.layouts))
val event = GetCurrentLayoutRespMsg(header, body)
val msgEvent = BbbCommonEnvCoreMsg(envelope, event)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ trait ValidateConnAuthTokenSysMsgHdlr {
val regUser = RegisteredUsers.getRegisteredUserWithToken(
msg.body.authToken,
msg.body.userId,
liveMeeting.registeredUsers
)
liveMeeting.registeredUsers)

regUser match {
case Some(u) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ trait PreuploadedPresentationsPubMsgHdlr {

def handle(
msg: PreuploadedPresentationsSysPubMsg,
liveMeeting: LiveMeeting, bus: MessageBus
): Unit = {
liveMeeting: LiveMeeting, bus: MessageBus): Unit = {

val presos = new collection.mutable.HashMap[String, Presentation]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ trait CreateDefaultPresentationPod {
liveMeeting.props.meetingProp.intId,
resultPod.currentPresenter,
resultPod.id,
SYSTEM_ID
)
SYSTEM_ID)

bus.outGW.send(respMsg)
val pods = state.presentationPodManager.addPod(resultPod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ trait CreateNewPresentationPodPubMsgHdlr extends RightsManagementTrait {

if (permissionFailed(
PermissionCheck.MOD_LEVEL,
PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId
)) {
PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
val meetingId = liveMeeting.props.meetingProp.intId
val reason = "No permission to create new presentation pod."
PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting)
Expand All @@ -30,8 +29,7 @@ trait CreateNewPresentationPodPubMsgHdlr extends RightsManagementTrait {
liveMeeting.props.meetingProp.intId,
resultPod.currentPresenter,
resultPod.id,
msg.header.userId
)
msg.header.userId)
bus.outGW.send(respMsg)

val pods = state.presentationPodManager.addPod(resultPod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ trait PresentationConversionCompletedSysPubMsgHdlr {

def handle(
msg: PresentationConversionCompletedSysPubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

val meetingId = liveMeeting.props.meetingProp.intId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ trait PresentationConversionUpdatePubMsgHdlr {
def broadcastEvent(msg: PresentationConversionUpdateSysPubMsg): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(PresentationConversionUpdateEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(
PresentationConversionUpdateEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)

val body = PresentationConversionUpdateEvtMsgBody(msg.body.podId, msg.body.messageKey,
msg.body.code, msg.body.presentationId, msg.body.presName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ trait PresentationPageCountErrorPubMsgHdlr {

def handle(
msg: PresentationPageCountErrorSysPubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

def broadcastEvent(msg: PresentationPageCountErrorSysPubMsg): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(PresentationPageCountErrorEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(
PresentationPageCountErrorEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)

val body = PresentationPageCountErrorEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.maxNumberPages, msg.body.presName)
val event = PresentationPageCountErrorEvtMsg(header, body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ trait PresentationPageGeneratedPubMsgHdlr {
def broadcastEvent(msg: PresentationPageGeneratedSysPubMsg): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(PresentationPageGeneratedEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(
PresentationPageGeneratedEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)

val body = PresentationPageGeneratedEvtMsgBody(msg.body.podId, msg.body.messageKey, msg.body.code, msg.body.presentationId, msg.body.numberOfPages, msg.body.pagesCompleted, msg.body.presName)
val event = PresentationPageGeneratedEvtMsg(header, body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ object PresentationSender {
podId: String, userId: String,
presentationId: String,
downloadable: Boolean,
presFilename: String
): Unit = {
presFilename: String): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
meetingId, userId
)
meetingId, userId)
val envelope = BbbCoreEnvelope(SetPresentationDownloadableEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(SetPresentationDownloadableEvtMsg.NAME, meetingId, userId)

Expand All @@ -30,12 +28,10 @@ object PresentationSender {
bus: MessageBus,
meetingId: String,
podId: String, userId: String, messageKey: String,
code: String, presentation: PresentationVO
): Unit = {
code: String, presentation: PresentationVO): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
meetingId, userId
)
meetingId, userId)
val envelope = BbbCoreEnvelope(PresentationConversionCompletedEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(PresentationConversionCompletedEvtMsg.NAME, meetingId, userId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ trait RemovePresentationPubMsgHdlr extends RightsManagementTrait {

def handle(
msg: RemovePresentationPubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

if (filterPresentationMessage(liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
Expand All @@ -24,8 +23,7 @@ trait RemovePresentationPubMsgHdlr extends RightsManagementTrait {
def broadcastRemovePresentationEvtMsg(podId: String, userId: String, presentationId: String): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, userId
)
liveMeeting.props.meetingProp.intId, userId)
val envelope = BbbCoreEnvelope(RemovePresentationEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(RemovePresentationEvtMsg.NAME, liveMeeting.props.meetingProp.intId, userId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ trait ResizeAndMovePagePubMsgHdlr extends RightsManagementTrait {
def broadcastEvent(msg: ResizeAndMovePagePubMsg, podId: String, page: PageVO): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)
val envelope = BbbCoreEnvelope(ResizeAndMovePageEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(
ResizeAndMovePageEvtMsg.NAME,
liveMeeting.props.meetingProp.intId, msg.header.userId
)
liveMeeting.props.meetingProp.intId, msg.header.userId)

val body = ResizeAndMovePageEvtMsgBody(podId, msg.body.presentationId, page.id,
page.xOffset, page.yOffset, page.widthRatio, page.heightRatio)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ trait SetCurrentPagePubMsgHdlr extends RightsManagementTrait {

def handle(
msg: SetCurrentPagePubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

if (filterPresentationMessage(liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
Expand All @@ -25,8 +24,7 @@ trait SetCurrentPagePubMsgHdlr extends RightsManagementTrait {
def broadcastSetCurrentPageEvtMsg(podId: String, presentationId: String, pageId: String, userId: String): Unit = {
val routing = Routing.addMsgToClientRouting(
MessageTypes.BROADCAST_TO_MEETING,
liveMeeting.props.meetingProp.intId, userId
)
liveMeeting.props.meetingProp.intId, userId)
val envelope = BbbCoreEnvelope(SetCurrentPageEvtMsg.NAME, routing)
val header = BbbClientMsgHeader(SetCurrentPageEvtMsg.NAME, liveMeeting.props.meetingProp.intId, userId)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ trait SetCurrentPresentationPubMsgHdlr extends RightsManagementTrait {

def handle(
msg: SetCurrentPresentationPubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

if (filterPresentationMessage(liveMeeting.users2x, msg.header.userId) &&
permissionFailed(PermissionCheck.GUEST_LEVEL, PermissionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.header.userId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ trait SetPresentationDownloadablePubMsgHdlr extends RightsManagementTrait {

def handle(
msg: SetPresentationDownloadablePubMsg, state: MeetingState2x,
liveMeeting: LiveMeeting, bus: MessageBus
): MeetingState2x = {
liveMeeting: LiveMeeting, bus: MessageBus): MeetingState2x = {

val meetingId = liveMeeting.props.meetingProp.intId

Expand Down
Loading

0 comments on commit cc6f88d

Please sign in to comment.