- remove participant from chat list when he/she logs out
git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@2114 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
parent
56aeba1abf
commit
8aa22f20ea
@ -9,7 +9,7 @@ package org.bigbluebutton.main.events
|
||||
public static const PARTICIPANT_JOINED_EVENT:String = 'PARTICIPANT_JOINED_EVENT';
|
||||
|
||||
public var participant:Participant;
|
||||
|
||||
public var join:Boolean = false;
|
||||
public function ParticipantJoinEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
|
||||
{
|
||||
super(type, bubbles, cancelable);
|
||||
|
@ -133,6 +133,7 @@ package org.bigbluebutton.modules.chat.services
|
||||
var globalDispatcher:Dispatcher = new Dispatcher();
|
||||
var joinEvent:ParticipantJoinEvent = new ParticipantJoinEvent(ParticipantJoinEvent.PARTICIPANT_JOINED_EVENT);
|
||||
joinEvent.participant = participant;
|
||||
joinEvent.join = true;
|
||||
globalDispatcher.dispatchEvent(joinEvent);
|
||||
}
|
||||
|
||||
|
@ -118,12 +118,18 @@
|
||||
localDispatcher.dispatchEvent(privateEvent);
|
||||
}
|
||||
|
||||
|
||||
private function handleParticipantJoinedEvent(event:ParticipantJoinEvent):void {
|
||||
var item:Object = new Object();
|
||||
item.label = event.participant.name;
|
||||
item.userid = event.participant.userid;
|
||||
participants.addItem(item);
|
||||
trace("New participant " + item.label + "[" + item.userid + "]");
|
||||
if (event.join) {
|
||||
participants.addItem(item);
|
||||
trace("New participant " + item.label + "[" + item.userid + "]");
|
||||
} else {
|
||||
trace("removing participant " + item.label + "[" + item.userid + "]");
|
||||
removeParticipantFromList(event.participant.userid);
|
||||
}
|
||||
}
|
||||
|
||||
public function addParticipant(userVO:UserVO):void{
|
||||
@ -138,8 +144,12 @@
|
||||
if (tabNav.getChildByName(name) == tabNav.selectedChild){
|
||||
txtMsg.enabled = false;
|
||||
}
|
||||
removeParticipantFromList(name);
|
||||
}
|
||||
|
||||
private function removeParticipantFromList(userid:String):void {
|
||||
for (var i:Number = 0; i<participants.length; i++){
|
||||
if (participants.getItemAt(i).userid == name) participants.removeItemAt(i);
|
||||
if (participants.getItemAt(i).userid == userid) participants.removeItemAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,11 +175,17 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
}
|
||||
|
||||
public function participantLeft(user:Object):void {
|
||||
|
||||
//This sends a notification that a user has left. Another dirty hack, by Denis
|
||||
var participant:User = _participants.getParticipant(Number(user));
|
||||
var userObj:Object = {username:participant.name, userid:participant.userid, userrole:participant.role};
|
||||
ViewersFacade.getInstance().sendNotification(ViewersModuleConstants.USER_LEFT, userObj);
|
||||
|
||||
var p:Participant = new Participant();
|
||||
p.userid = String(participant.userid);
|
||||
p.name = participant.name;
|
||||
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
var joinEvent:ParticipantJoinEvent = new ParticipantJoinEvent(ParticipantJoinEvent.PARTICIPANT_JOINED_EVENT);
|
||||
joinEvent.participant = p;
|
||||
joinEvent.join = false;
|
||||
dispatcher.dispatchEvent(joinEvent);
|
||||
|
||||
_participants.removeParticipant(Number(user));
|
||||
}
|
||||
@ -207,10 +213,8 @@ package org.bigbluebutton.modules.viewers.model.services
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
var joinEvent:ParticipantJoinEvent = new ParticipantJoinEvent(ParticipantJoinEvent.PARTICIPANT_JOINED_EVENT);
|
||||
joinEvent.participant = participant;
|
||||
joinEvent.join = true;
|
||||
dispatcher.dispatchEvent(joinEvent);
|
||||
//This sends a notification that a new user has joined to other modules. Right now a dirty, dirty hack - Denis
|
||||
var userObj:Object = {username:user.name, userid:user.userid, userrole:user.role};
|
||||
ViewersFacade.getInstance().sendNotification(ViewersModuleConstants.USER_JOINED, userObj);
|
||||
}
|
||||
|
||||
public function participantStatusChange(userid:Number, status:String, value:Object):void {
|
||||
|
Loading…
Reference in New Issue
Block a user