Merge pull request #4644 from antobinary/guest-work

Guest Management - handle individual guests approv vs deny (client side improvements)
This commit is contained in:
Anton Georgiev 2017-11-09 13:09:49 -02:00 committed by GitHub
commit 3dc6c183d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 4 deletions

View File

@ -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);
}
}
}

View File

@ -73,6 +73,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{BBBEvent.WAITING_FOR_MODERATOR_ACCEPTANCE}" method="openWaitWindow" /> <mate:Listener type="{BBBEvent.WAITING_FOR_MODERATOR_ACCEPTANCE}" method="openWaitWindow" />
<mate:Listener type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}" method="closeWaitWindow"/> <mate:Listener type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}" method="closeWaitWindow"/>
<mate:Listener type="{RoundTripLatencyReceivedEvent.ROUND_TRIP_LATENCY_RECEIVED}" method="handleRoundTripLatencyReceivedEvent"/> <mate:Listener type="{RoundTripLatencyReceivedEvent.ROUND_TRIP_LATENCY_RECEIVED}" method="handleRoundTripLatencyReceivedEvent"/>
<mate:Listener type="{ClosePendingGuestWindow.CLOSE_PENDING_GUEST_WINDOW}" method="handleClosePendingGuestWindow" />
</fx:Declarations> </fx:Declarations>
<fx:Script> <fx:Script>
<![CDATA[ <![CDATA[
@ -110,6 +111,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.core.events.NewGuestWaitingEvent; import org.bigbluebutton.core.events.NewGuestWaitingEvent;
import org.bigbluebutton.core.events.RoundTripLatencyReceivedEvent; import org.bigbluebutton.core.events.RoundTripLatencyReceivedEvent;
import org.bigbluebutton.core.events.SwitchedLayoutEvent; import org.bigbluebutton.core.events.SwitchedLayoutEvent;
import org.bigbluebutton.core.events.ClosePendingGuestWindow;
import org.bigbluebutton.core.model.LiveMeeting;
import org.bigbluebutton.core.vo.LockSettingsVO; import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.main.events.AppVersionEvent; import org.bigbluebutton.main.events.AppVersionEvent;
import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.BBBEvent;
@ -183,6 +186,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var resizeExecuting:Boolean = false; private var resizeExecuting:Boolean = false;
private var _respTimer:ResponsivenessTimer; private var _respTimer:ResponsivenessTimer;
private var guestWindow:PendingGuestsWindow;
public function getLogWindow() : LogWindow public function getLogWindow() : LogWindow
{ {
@ -332,19 +337,30 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function refreshGuestView(evt:NewGuestWaitingEvent):void { 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 // 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) { if (!UsersUtil.amIModerator() || UsersUtil.amIWaitingForAcceptance() && usersOptions.enableGuestUI) {
return; return;
} }
LOGGER.debug("OPENING GUEST WINDOW"); var guestUsers:ArrayCollection = new ArrayCollection(LiveMeeting.inst().guestsWaiting.getGuests());
var guestWindow:PendingGuestsWindow = PopUpUtil.createModalPopUp( mdiCanvas, PendingGuestsWindow, false) as PendingGuestsWindow;
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.x = systemManager.screen.width - guestWindow.width - 20;
guestWindow.y = 20; guestWindow.y = 20;
}
guestWindow.refreshGuestView(); guestWindow.refreshGuestView();
} }
private function handleClosePendingGuestWindow(event: ClosePendingGuestWindow): void {
if (guestWindow != null) {
PopUpUtil.removePopUp(guestWindow);
guestWindow = null;
}
}
public function removeGuestWindow(evt:BBBEvent):void { public function removeGuestWindow(evt:BBBEvent):void {
LOGGER.debug("REMOVE GUEST WINDOW"); LOGGER.debug("REMOVE GUEST WINDOW");
//if (guestWindow != null) { //if (guestWindow != null) {

View File

@ -32,6 +32,7 @@ $Id: $
<fx:Declarations> <fx:Declarations>
<mate:Listener type="{BBBEvent.ACCEPT_ALL_WAITING_GUESTS}" method="acceptAllWaitingGuests" /> <mate:Listener type="{BBBEvent.ACCEPT_ALL_WAITING_GUESTS}" method="acceptAllWaitingGuests" />
<mate:Listener type="{BBBEvent.DENY_ALL_WAITING_GUESTS}" method="denyAllWaitingGuests" /> <mate:Listener type="{BBBEvent.DENY_ALL_WAITING_GUESTS}" method="denyAllWaitingGuests" />
<mate:Listener type="{GuestWaitingApprovedEvent.GUEST_WAITING_APPROVED}" method="handleGuestWaitingApprovedEvent" />
<mate:Listener type="{RemoveGuestFromViewEvent.REMOVE_GUEST}" receive="{remove(event.userid)}" /> <mate:Listener type="{RemoveGuestFromViewEvent.REMOVE_GUEST}" receive="{remove(event.userid)}" />
</fx:Declarations> </fx:Declarations>
@ -45,6 +46,8 @@ $Id: $
import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.model.LiveMeeting;
import org.bigbluebutton.core.model.users.GuestWaiting; import org.bigbluebutton.core.model.users.GuestWaiting;
import org.bigbluebutton.main.events.BBBEvent; 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.RemoveGuestEvent;
import org.bigbluebutton.main.events.RemoveGuestFromViewEvent; import org.bigbluebutton.main.events.RemoveGuestFromViewEvent;
import org.bigbluebutton.main.events.ResponseModeratorEvent; import org.bigbluebutton.main.events.ResponseModeratorEvent;
@ -90,6 +93,13 @@ $Id: $
public function denyAllWaitingGuests(event:BBBEvent):void { public function denyAllWaitingGuests(event:BBBEvent):void {
sendResponseToAllGuests(false); sendResponseToAllGuests(false);
} }
private function handleGuestWaitingApprovedEvent(event: GuestWaitingApprovedEvent): void {
refreshGuestView();
if (guestUsers.length == 0) {
closeWindow();
}
}
public function removeAllGuests():void { public function removeAllGuests():void {
closeWindow(); closeWindow();
@ -108,7 +118,8 @@ $Id: $
} }
public function closeWindow():void { public function closeWindow():void {
PopUpUtil.removePopUp(this); var event:ClosePendingGuestWindow = new ClosePendingGuestWindow();
dispatcher.dispatchEvent(event);
} }
]]> ]]>