- notify JS API that user has left the meeting

This commit is contained in:
Richard Alam 2013-05-02 18:41:48 +00:00
parent 0b902805b0
commit 97884b8cc8
2 changed files with 10 additions and 3 deletions

View File

@ -276,10 +276,13 @@ package org.bigbluebutton.main.api
} }
public function handleUserLeftEvent(event:UserLeftEvent):void { public function handleUserLeftEvent(event:UserLeftEvent):void {
trace("Got notification that user [" + event.userID + "] has left the meeting");
var payload:Object = new Object(); var payload:Object = new Object();
var user:BBBUser = UserManager.getInstance().getConference().getUser(event.userID); var user:BBBUser = UserManager.getInstance().getConference().getUser(event.userID);
if (user == null) { if (user == null) {
trace("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]");
LogUtil.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]"); LogUtil.warn("[ExternalApiCall:handleParticipantJoinEvent] Cannot find user with ID [" + event.userID + "]");
return; return;
} }
@ -287,6 +290,8 @@ package org.bigbluebutton.main.api
payload.eventName = EventConstants.USER_LEFT; payload.eventName = EventConstants.USER_LEFT;
payload.userID = UsersUtil.internalUserIDToExternalUserID(user.userID); payload.userID = UsersUtil.internalUserIDToExternalUserID(user.userID);
trace("Notifying JS API that user [" + payload.userID + "] has left the meeting");
broadcastEvent(payload); broadcastEvent(payload);
} }

View File

@ -215,12 +215,14 @@ package org.bigbluebutton.main.model.users {
public function participantLeft(userID:String):void { public function participantLeft(userID:String):void {
var user:BBBUser = UserManager.getInstance().getConference().getUser(userID); var user:BBBUser = UserManager.getInstance().getConference().getUser(userID);
UserManager.getInstance().getConference().removeUser(userID); trace("Notify others that user [" + user.userID + "] has left!!!!");
var joinEvent:UserLeftEvent = new UserLeftEvent(UserLeftEvent.LEFT); var joinEvent:UserLeftEvent = new UserLeftEvent(UserLeftEvent.LEFT);
joinEvent.userID = user.userID; joinEvent.userID = user.userID;
dispatcher.dispatchEvent(joinEvent); dispatcher.dispatchEvent(joinEvent);
UserManager.getInstance().getConference().removeUser(userID);
} }
public function participantJoined(joinedUser:Object):void { public function participantJoined(joinedUser:Object):void {