From 0d915a0c568179eea3b7a2a6d153cd4a6463f1bf Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 8 Nov 2017 18:10:24 -0500 Subject: [PATCH 1/2] handle PendingGuestWindow when there are 1+ guests waiting --- .../main/views/MainApplicationShell.mxml | 20 ++++++++++++++++--- .../main/views/PendingGuestsWindow.mxml | 9 +++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index a86858e866..10c03f9995 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -73,6 +73,7 @@ with BigBlueButton; if not, see . + . import org.bigbluebutton.core.events.NewGuestWaitingEvent; import org.bigbluebutton.core.events.RoundTripLatencyReceivedEvent; import org.bigbluebutton.core.events.SwitchedLayoutEvent; + import org.bigbluebutton.core.events.GuestWaitingApprovedEvent; + import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.vo.LockSettingsVO; import org.bigbluebutton.main.events.AppVersionEvent; import org.bigbluebutton.main.events.BBBEvent; @@ -183,6 +186,8 @@ with BigBlueButton; if not, see . private var resizeExecuting:Boolean = false; private var _respTimer:ResponsivenessTimer; + + private var guestWindow:PendingGuestsWindow; public function getLogWindow() : LogWindow { @@ -332,19 +337,28 @@ with BigBlueButton; if not, see . } private function refreshGuestView(evt:NewGuestWaitingEvent):void { - LOGGER.debug("NewGuestWaitingEvent"); + LOGGER.debug("NewGuestWaitingEvent"); // do not show the guest window if the user isn't moderator or if he's waiting for acceptance if (!UsersUtil.amIModerator() || UsersUtil.amIWaitingForAcceptance() && usersOptions.enableGuestUI) { return; } - LOGGER.debug("OPENING GUEST WINDOW"); - var guestWindow:PendingGuestsWindow = PopUpUtil.createModalPopUp( mdiCanvas, PendingGuestsWindow, false) as PendingGuestsWindow; + var guestUsers:ArrayCollection = new ArrayCollection(LiveMeeting.inst().guestsWaiting.getGuests()); + + LOGGER.debug("OPENING GUEST WINDOW"); + if (guestWindow == null) { + guestWindow = PopUpUtil.createModalPopUp( mdiCanvas, PendingGuestsWindow, false) as PendingGuestsWindow; guestWindow.x = systemManager.screen.width - guestWindow.width - 20; guestWindow.y = 20; + } guestWindow.refreshGuestView(); } + // reset the PendingGuestsWindow window so it can be recreated for the next joiner + private function handleGuestWaitingApprovedEvent(event: GuestWaitingApprovedEvent): void { + guestWindow = null; + } + public function removeGuestWindow(evt:BBBEvent):void { LOGGER.debug("REMOVE GUEST WINDOW"); //if (guestWindow != null) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml index 51afb426d9..9f461a84a8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml @@ -32,6 +32,7 @@ $Id: $ + @@ -45,6 +46,7 @@ $Id: $ import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.model.users.GuestWaiting; import org.bigbluebutton.main.events.BBBEvent; + import org.bigbluebutton.core.events.GuestWaitingApprovedEvent; import org.bigbluebutton.main.events.RemoveGuestEvent; import org.bigbluebutton.main.events.RemoveGuestFromViewEvent; import org.bigbluebutton.main.events.ResponseModeratorEvent; @@ -90,6 +92,13 @@ $Id: $ public function denyAllWaitingGuests(event:BBBEvent):void { sendResponseToAllGuests(false); } + + private function handleGuestWaitingApprovedEvent(event: GuestWaitingApprovedEvent): void { + refreshGuestView(); + if (guestUsers.length == 0) { + closeWindow(); + } + } public function removeAllGuests():void { closeWindow(); From eb3f8aec5b9db7cac252a262750a36050eb9e39f Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 8 Nov 2017 18:41:51 -0500 Subject: [PATCH 2/2] close PendingGuestsWindow only from parent --- .../core/events/ClosePendingGuestWindow.as | 14 ++++++++++++++ .../main/views/MainApplicationShell.mxml | 12 +++++++----- .../main/views/PendingGuestsWindow.mxml | 4 +++- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as b/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as new file mode 100644 index 0000000000..5e9a69a8bd --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/core/events/ClosePendingGuestWindow.as @@ -0,0 +1,14 @@ +package org.bigbluebutton.core.events +{ + import flash.events.Event; + + public class ClosePendingGuestWindow extends Event + { + public static const CLOSE_PENDING_GUEST_WINDOW: String = "CLOSE_PENDING_GUEST_WINDOW"; + + public function ClosePendingGuestWindow() + { + super(CLOSE_PENDING_GUEST_WINDOW, false, false); + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 10c03f9995..6807b60756 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -73,7 +73,7 @@ with BigBlueButton; if not, see . - + . import org.bigbluebutton.core.events.NewGuestWaitingEvent; import org.bigbluebutton.core.events.RoundTripLatencyReceivedEvent; import org.bigbluebutton.core.events.SwitchedLayoutEvent; - import org.bigbluebutton.core.events.GuestWaitingApprovedEvent; + import org.bigbluebutton.core.events.ClosePendingGuestWindow; import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.vo.LockSettingsVO; import org.bigbluebutton.main.events.AppVersionEvent; @@ -354,9 +354,11 @@ with BigBlueButton; if not, see . guestWindow.refreshGuestView(); } - // reset the PendingGuestsWindow window so it can be recreated for the next joiner - private function handleGuestWaitingApprovedEvent(event: GuestWaitingApprovedEvent): void { - guestWindow = null; + private function handleClosePendingGuestWindow(event: ClosePendingGuestWindow): void { + if (guestWindow != null) { + PopUpUtil.removePopUp(guestWindow); + guestWindow = null; + } } public function removeGuestWindow(evt:BBBEvent):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml index 9f461a84a8..de2390f838 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/PendingGuestsWindow.mxml @@ -47,6 +47,7 @@ $Id: $ import org.bigbluebutton.core.model.users.GuestWaiting; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.core.events.GuestWaitingApprovedEvent; + import org.bigbluebutton.core.events.ClosePendingGuestWindow; import org.bigbluebutton.main.events.RemoveGuestEvent; import org.bigbluebutton.main.events.RemoveGuestFromViewEvent; import org.bigbluebutton.main.events.ResponseModeratorEvent; @@ -117,7 +118,8 @@ $Id: $ } public function closeWindow():void { - PopUpUtil.removePopUp(this); + var event:ClosePendingGuestWindow = new ClosePendingGuestWindow(); + dispatcher.dispatchEvent(event); } ]]>