diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/Guest.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/Guest.as new file mode 100644 index 0000000000..8feee91e9d --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/Guest.as @@ -0,0 +1,62 @@ +/** +* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ +* +* Copyright (c) 2013 BigBlueButton Inc. and by respective authors (see below). +* +* This program is free software; you can redistribute it and/or modify it under the +* terms of the GNU Lesser General Public License as published by the Free Software +* Foundation; either version 2.1 of the License, or (at your option) any later +* version. +* +* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License along +* with BigBlueButton; if not, see . +* +* author: +*/ +package org.bigbluebutton.main.model +{ + + import com.asfusion.mate.events.Dispatcher; + + + public class Guest + { + private var listOfGuests:Object = new Object(); + private var numberOfGuests = 0; + private var dispatcher; + + function Guest(dispatcher:Dispatcher) { + this.dispatcher = dispatcher; + } + + public function hasGuest():Boolean { + return numberOfGuests > 0; + } + + public function getNumberOfGuests():Number { + return numberOfGuests; + } + + public function addGuest(userID:Number, userName:String):void { + var guest:Object = {userid:userID, username:userName}; + listOfGuests.addItem(guest); + numberOfGuests++; + } + + public function removeAllGuests():void { + listOfGuests = new Object(); + numberOfGuests = 0; + } + + public function remove(userid:Number):void { + if (listOfGuests[userid] != null) { + numberOfGuests--; + delete listOfGuests[userid]; + } + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml index 0497d07d0d..a92ea0d273 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml @@ -45,7 +45,6 @@ import mx.controls.Spacer; import org.bigbluebutton.main.events.BBBEvent; - private var urlLoader:URLLoader; private var guestWindowMap:Object = new Object(); private var guestButtons:Object = new Object(); [Bindable] private var numberOfGuests:Number = 0; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index bdac55ab42..7c9c91cfe2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -45,7 +45,7 @@ - + @@ -87,6 +87,7 @@ import org.bigbluebutton.main.events.ModeratorRespEvent; import org.bigbluebutton.main.model.LayoutOptions; import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent; + import org.bigbluebutton.main.model.Guest; import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.util.logging.Logger; import org.bigbluebutton.common.events.SettingsComponentEvent; @@ -118,6 +119,7 @@ private var receivedConfigLocaleVer:Boolean = false; private var receivedResourceLocaleVer:Boolean = false; private var guestManagement:GuestManagement = null; + private var guest:Guest = new Guest(); private var guestPolicy:String = "ASK_MODERATOR"; @@ -211,14 +213,14 @@ } } - private function newGuestWindow(evt:NewGuestEvent):void { - if(guestWindow == null) { - guestWindow = PopUpManager.createPopUp( mdiCanvas, GuestWindow, false) as GuestWindow; - guestWindow.x = width - 400; - guestWindow.y = 20; - } - - guestWindow.addGuest(evt.userid, evt.name); + private function addNewGuest(evt:NewGuestEvent):void { + guest.addGuest(evt.userid, evt.name); + //if(guestWindow == null) { + // guestWindow = PopUpManager.createPopUp( mdiCanvas, GuestWindow, false) as GuestWindow; + // guestWindow.x = width - 400; + // guestWindow.y = 20; + //} + //guestWindow.addGuest(evt.userid, evt.name); } public function removeGuestWindow(evt:RemoveGuestRequestEvent):void {