Merge branch '090-guest-role-refactoring' into mconf-live0.6.3

Conflicts:
	bigbluebutton-apps/src/main/java/org/bigbluebutton/core/api/IBigBlueButtonInGW.java
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/CollectorActor.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/MeetingActor.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/MessageNames.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/api/ValueObjects.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/red5/UsersClientMessageSender.scala
	bigbluebutton-apps/src/main/scala/org/bigbluebutton/core/apps/users/redis/UsersMessageToJsonConverter.scala
	bigbluebutton-client/branding/default/style/css/BBBDefault.css
	bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as
	bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml
	bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml
	bigbluebutton-client/src/org/bigbluebutton/modules/users/maps/UsersMainEventMap.mxml
	bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as
	bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy
	bigbluebutton-web/src/java/org/bigbluebutton/api/domain/User.java
This commit is contained in:
Felipe Cecagno 2015-04-23 14:37:17 -03:00
commit 12cab928de
53 changed files with 1468 additions and 2116 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,8 +19,7 @@ with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
Author: Fred Dixon <ffdixon@bigbluebutton.org>
-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
@ -283,7 +282,7 @@ Error: createMeeting() failed
//
// We've got a valid meeting_ID and passoword -- let's join!
//
String joinURL;
if(request.getParameter("guest") != null)
joinURL = getJoinMeetingURL(username, meeting_ID, password, null, true);

View File

@ -137,7 +137,7 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
if (params.length >= 10 && ((Boolean) params[10])) {
guest = true;
}
if (record == true) {
recorderApplication.createRecordSession(room);
}

View File

@ -79,32 +79,16 @@ public class ParticipantsApplication {
bbbInGW.getRecordingStatus(meetingId, userId);
}
public void askingToEnter(String meetingId, String userId) {
bbbInGW.userRequestToEnter(meetingId, userId);
}
public void getGuestPolicy(String meetingId, String requesterId) {
bbbInGW.getGuestPolicy(meetingId, requesterId);
}
public void newGuestPolicy(String meetingId, String guestPolicy) {
bbbInGW.setGuestPolicy(meetingId, guestPolicy);
public void newGuestPolicy(String meetingId, String guestPolicy, String setBy) {
bbbInGW.setGuestPolicy(meetingId, guestPolicy, setBy);
}
public void askingForGuestWaiting(String meetingId, String requesterId) {
bbbInGW.getGuestsWaiting(meetingId, requesterId);
}
public void responseToGuest(String meetingId, String userId, Boolean resp) {
bbbInGW.responseToGuest(meetingId, userId, resp);
}
public void responseToAllGuests(String meetingId, Boolean resp) {
bbbInGW.responseToAllGuests(meetingId, resp);
}
public void kickGuest(String meetingId, String guestId) {
bbbInGW.kickGuest(meetingId, guestId);
public void responseToGuest(String meetingId, String userId, Boolean response, String requesterId) {
bbbInGW.responseToGuest(meetingId, userId, response, requesterId);
}
public void setParticipantRole(String meetingId, String userId, String role) {

View File

@ -99,12 +99,6 @@ public class ParticipantsService {
return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION);
}
public void askingToEnter() {
String userId = getBbbSession().getInternalUserID();
String roomName = Red5.getConnectionLocal().getScope().getName();
application.askingToEnter(roomName, userId);
}
public void getGuestPolicy() {
String requesterId = getBbbSession().getInternalUserID();
String roomName = Red5.getConnectionLocal().getScope().getName();
@ -112,29 +106,15 @@ public class ParticipantsService {
}
public void setGuestPolicy(String guestPolicy) {
String requesterId = getBbbSession().getInternalUserID();
String roomName = Red5.getConnectionLocal().getScope().getName();
application.newGuestPolicy(roomName, guestPolicy);
}
public void getGuestsWaiting() {
String userId = getBbbSession().getInternalUserID();
String roomName = Red5.getConnectionLocal().getScope().getName();
application.askingForGuestWaiting(roomName, userId);
}
public void responseToAllGuests(Boolean resp) {
String roomName = Red5.getConnectionLocal().getScope().getName();
application.responseToAllGuests(roomName, resp);
application.newGuestPolicy(roomName, guestPolicy, requesterId);
}
public void responseToGuest(Map<String, Object> msg) {
String requesterId = getBbbSession().getInternalUserID();
String roomName = Red5.getConnectionLocal().getScope().getName();
application.responseToGuest(roomName, (String) msg.get("guestID"), (Boolean) msg.get("response"));
}
public void kickGuest(String guestId) {
String roomName = Red5.getConnectionLocal().getScope().getName();
application.kickGuest(roomName, guestId);
application.responseToGuest(roomName, (String) msg.get("userId"), (Boolean) msg.get("response"), requesterId);
}
public void setParticipantRole(Map<String, String> msg) {

View File

@ -44,13 +44,9 @@ public interface IBigBlueButtonInGW {
void getRecordingStatus(String meetingId, String userId);
void userConnectedToGlobalAudio(String voiceConf, String userid, String name);
void userDisconnectedFromGlobalAudio(String voiceConf, String userid, String name);
void userRequestToEnter(String meetingID, String userID);
void getGuestPolicy(String meetingID, String userID);
void setGuestPolicy(String meetingID, String guestPolicy);
void getGuestsWaiting(String meetingID, String requesterID);
void responseToGuest(String meetingID, String userID, Boolean response);
void responseToAllGuests(String meetingID, Boolean response);
void kickGuest(String meetingID, String guestID);
void setGuestPolicy(String meetingID, String guestPolicy, String setBy);
void responseToGuest(String meetingID, String userID, Boolean response, String requesterID);
// Voice
void muteAllExceptPresenter(String meetingID, String requesterID, Boolean mute);

View File

@ -198,15 +198,11 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway, presUtil: PreuploadedPresen
}
// Guest support
def userRequestToEnter(meetingID: String, userID: String) {
bbbGW.accept(new UserRequestToEnter(meetingID, userID))
}
def getGuestPolicy(meetingID: String, requesterID: String) {
bbbGW.accept(new GetGuestPolicy(meetingID, requesterID))
}
def setGuestPolicy(meetingID: String, guestPolicy: String) {
def setGuestPolicy(meetingID: String, guestPolicy: String, setBy: String) {
val policy = guestPolicy.toUpperCase() match {
case "ALWAYS_ACCEPT" => GuestPolicy.ALWAYS_ACCEPT
case "ALWAYS_DENY" => GuestPolicy.ALWAYS_DENY
@ -214,25 +210,13 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway, presUtil: PreuploadedPresen
//default
case undef => GuestPolicy.ASK_MODERATOR
}
bbbGW.accept(new SetGuestPolicy(meetingID, policy))
bbbGW.accept(new SetGuestPolicy(meetingID, policy, setBy))
}
def getGuestsWaiting(meetingID: String, requesterID: String) {
bbbGW.accept(new GetGuestsWaiting(meetingID, requesterID))
def responseToGuest(meetingID: String, userId: String, response: java.lang.Boolean, requesterID: String) {
bbbGW.accept(new RespondToGuest(meetingID, userId, response, requesterID))
}
def responseToGuest(meetingID: String, guestID: String, response: java.lang.Boolean) {
bbbGW.accept(new RespondToGuest(meetingID, guestID, response))
}
def responseToAllGuests(meetingID: String, response: java.lang.Boolean) {
bbbGW.accept(new RespondToAllGuests(meetingID, response))
}
def kickGuest(meetingID: String, guestID: String) {
bbbGW.accept(new KickGuest(meetingID, guestID))
}
/**************************************************************************************
* Message Interface for Presentation
**************************************************************************************/

View File

@ -98,12 +98,9 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
case msg: EnableWhiteboardRequest => handleEnableWhiteboardRequest(msg)
case msg: IsWhiteboardEnabledRequest => handleIsWhiteboardEnabledRequest(msg)
case msg: GetStreamPath => handleGetStreamPath(msg)
case msg: UserRequestToEnter => handleUserRequestToEnter(msg)
case msg: GetGuestPolicy => handleGetGuestPolicy(msg)
case msg: SetGuestPolicy => handleSetGuestPolicy(msg)
case msg: GetGuestsWaiting => handleGetGuestsWaiting(msg)
case msg: RespondToGuest => handleRespondToGuest(msg)
case msg: KickGuest => handleKickGuest(msg)
case msg: GetAllMeetingsRequest => handleGetAllMeetingsRequest(msg)
//OUT MESSAGES
@ -184,12 +181,9 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
case msg: UndoWhiteboardEvent => handleUndoWhiteboardEvent(msg)
case msg: WhiteboardEnabledEvent => handleWhiteboardEnabledEvent(msg)
case msg: IsWhiteboardEnabledReply => handleIsWhiteboardEnabledReply(msg)
case msg: GuestRequestedToEnter => handleGuestRequestedToEnter(msg)
case msg: GetGuestPolicyReply => handleGetGuestPolicyReply(msg)
case msg: GuestPolicyChanged => handleGuestPolicyChanged(msg)
case msg: GetGuestsWaitingReply => handleGetGuestsWaitingReply(msg)
case msg: ResponseToGuest => handleResponseToGuest(msg)
case msg: GuestKicked => handleGuestKicked(msg)
case msg: GuestAccessDenied => handleGuestAccessDenied(msg)
case msg: GetAllMeetingsReply => handleGetAllMeetingsReply(msg)
case _ => // do nothing
@ -220,6 +214,8 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
wuser.put(Constants.LOCKED, user.locked:java.lang.Boolean)
wuser.put(Constants.WEBCAM_STREAM, user.webcamStreams)
wuser.put(Constants.PHONE_USER, user.phoneUser:java.lang.Boolean)
wuser.put(Constants.GUEST, user.guest:java.lang.Boolean)
wuser.put(Constants.WAITING_FOR_ACCEPTANCE, user.waitingForAcceptance:java.lang.Boolean)
wuser.put(Constants.VOICE_USER, vuser)
wuser
@ -2223,20 +2219,6 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
dispatcher.dispatch(buildJson(header, payload))
}
private def handleUserRequestToEnter(msg: UserRequestToEnter) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.userID)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.USER_REQUEST_TO_ENTER)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING USER REQUEST TO ENTER *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGetGuestPolicy(msg: GetGuestPolicy) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
@ -2265,25 +2247,12 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGetGuestsWaiting(msg: GetGuestsWaiting) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.REQUESTER_ID, msg.requesterID)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.GET_GUESTS_WAITING)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING GET GUESTS WAITING *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleRespondToGuest(msg: RespondToGuest) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.guestID)
payload.put(Constants.USER_ID, msg.userId)
payload.put(Constants.RESPONSE, msg.response.toString())
payload.put(Constants.REQUESTER_ID, msg.requesterID)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.RESPOND_TO_GUEST)
@ -2294,35 +2263,6 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
dispatcher.dispatch(buildJson(header, payload))
}
private def handleKickGuest(msg: KickGuest) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.guestID)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.KICK_GUEST)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING KICK GUEST *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGuestRequestedToEnter(msg: GuestRequestedToEnter) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.userID)
payload.put(Constants.NAME, msg.name)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.GUEST_REQUESTED_TO_ENTER)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING GUEST REQUESTED TO ENTER *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGetGuestPolicyReply(msg: GetGuestPolicyReply) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
@ -2352,29 +2292,13 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGetGuestsWaitingReply(msg: GetGuestsWaitingReply) {
private def handleGuestAccessDenied(msg: GuestAccessDenied) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.REQUESTER_ID, msg.requesterID)
payload.put(Constants.GUESTS_WAITING, msg.guestsWaiting)
payload.put(Constants.USER_ID, msg.userId)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.GET_GUESTS_WAITING_REPLY)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING GET GUESTS WAITING REPLY *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleResponseToGuest(msg: ResponseToGuest) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.guestID)
payload.put(Constants.RESPONSE, msg.response)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.RESPONSE_TO_GUEST)
header.put(Constants.NAME, MessageNames.GUEST_ACCESS_DENIED)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
@ -2382,20 +2306,6 @@ class CollectorActor(dispatcher: IDispatcher) extends Actor {
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGuestKicked(msg: GuestKicked) {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingID)
payload.put(Constants.USER_ID, msg.guestID)
val header = new java.util.HashMap[String, Any]()
header.put(Constants.NAME, MessageNames.GUEST_KICKED)
header.put(Constants.TIMESTAMP, TimestampGenerator.generateTimestamp)
header.put(Constants.CURRENT_TIME, TimestampGenerator.getCurrentTime)
// println("***** DISPATCHING GUEST KICKED *****************")
dispatcher.dispatch(buildJson(header, payload))
}
private def handleGetAllMeetingsReply(msg: GetAllMeetingsReply) {
val json = MeetingMessageToJsonConverter.getAllMeetingsReplyToJson(msg)
println("***** DISPATCHING GET ALL MEETINGS REPLY OUTMSG *****************")

View File

@ -34,7 +34,9 @@ class MeetingActor(val meetingID: String, val externalMeetingID: String, val mee
var recording = false;
var muted = false;
var meetingEnded = false
var guestPolicy = GuestPolicy.ASK_MODERATOR
var guestPolicySetBy:String = null
def getDuration():Long = {
duration
@ -136,13 +138,9 @@ class MeetingActor(val meetingID: String, val externalMeetingID: String, val mee
case msg: GetRecordingStatus => handleGetRecordingStatus(msg)
case msg: VoiceRecording => handleVoiceRecording(msg)
case msg: GetStreamPath => handleGetStreamPath(msg)
case msg: UserRequestToEnter => handleUserRequestToEnter(msg)
case msg: GetGuestPolicy => handleGetGuestPolicy(msg)
case msg: SetGuestPolicy => handleSetGuestPolicy(msg)
case msg: GetGuestsWaiting => handleGetGuestsWaiting(msg)
case msg: RespondToGuest => handleRespondToGuest(msg)
case msg: RespondToAllGuests => handleRespondToAllGuests(msg)
case msg: KickGuest => handleKickGuest(msg)
case msg: PatchDocumentRequest => handlePatchDocumentRequest(msg)
case msg: GetCurrentDocumentRequest => handleGetCurrentDocumentRequest(msg)
@ -267,6 +265,7 @@ class MeetingActor(val meetingID: String, val externalMeetingID: String, val mee
private def handleSetGuestPolicy(msg: SetGuestPolicy) {
guestPolicy = msg.policy
guestPolicySetBy = msg.setBy
outGW.send(new GuestPolicyChanged(msg.meetingID, recorded, guestPolicy.toString()))
}

View File

@ -97,6 +97,7 @@ object Constants {
val STREAM_PATH = "stream_path"
val STREAM_PATH_DEFAULT = "stream_path_default"
val GUEST = "guest"
val WAITING_FOR_ACCEPTANCE = "waiting_for_acceptance"
val GUEST_POLICY = "guest_policy"
val GUESTS_WAITING = "guests_waiting"
}
}

View File

@ -202,11 +202,6 @@ case class UserDisconnectedFromGlobalAudio(
) extends InMessage
// Guest support
case class UserRequestToEnter(
meetingID: String,
userID: String
) extends InMessage
case class GetGuestPolicy(
meetingID: String,
requesterID: String
@ -214,28 +209,15 @@ case class GetGuestPolicy(
case class SetGuestPolicy(
meetingID: String,
policy: GuestPolicy
) extends InMessage
case class GetGuestsWaiting(
meetingID: String,
requesterID: String
policy: GuestPolicy,
setBy: String
) extends InMessage
case class RespondToGuest(
meetingID: String,
guestID: String,
response: Boolean
) extends InMessage
case class RespondToAllGuests(
meetingID: String,
response: Boolean
) extends InMessage
case class KickGuest(
meetingID: String,
guestID: String
userId: String,
response: Boolean,
requesterID: String
) extends InMessage
// Layout

View File

@ -1,180 +1,173 @@
package org.bigbluebutton.core.api
object MessageNames {
val CREATE_MEETING = "create_meeting_request"
val INITIALIZE_MEETING = "initialize_meeting_request"
val DESTROY_MEETING = "destroy_meeting_request"
val START_MEETING = "start_meeting_request"
val END_MEETING = "end_meeting_request"
val LOCK_SETTING = "lock_setting_request"
val LOCK_USER = "lock_user_request"
val INIT_LOCK_SETTINGS = "init_lock_settings"
val SET_LOCK_SETTINGS = "set_lock_settings"
val GET_LOCK_SETTINGS = "get_lock_settings"
val IS_MEETING_LOCKED = "is_meeting_locked"
val VALIDATE_AUTH_TOKEN = "validate_auth_token_request"
val VALIDATE_AUTH_TOKEN_REPLY = "validate_auth_token_reply"
val REGISTER_USER = "register_user_request"
val USER_JOINING = "user_joining_request"
val USER_LEAVING = "user_leaving_request"
val GET_USERS = "get_users_request"
val RAISE_HAND = "user_raise_hand_request"
val LOWER_HAND = "user_lower_hand_request"
val USER_SHARE_WEBCAM = "user_share_webcam_request"
val USER_UNSHARE_WEBCAM = "user_unshare_webcam_request"
val CHANGE_USER_STATUS = "change_user_status_request"
val CHANGE_USER_ROLE = "change_user_role_request"
val ASSIGN_PRESENTER = "assign_presenter_request"
val SET_RECORDING_STATUS = "set_recording_status_request"
val GET_CHAT_HISTORY = "get_chat_history_request"
val SEND_PUBLIC_MESSAGE = "send_public_chat_message_request"
val SEND_PRIVATE_MESSAGE = "send_private_chat_message_request"
val GET_CURRENT_LAYOUT = "get_current_layout_request"
val SET_LAYOUT = "set_layout_request"
val BROADCAST_LAYOUT = "broadcast_layout_request"
val UNLOCK_LAYOUT = "unlock_layout_request"
val PRECREATED_POLL = "precreated_poll_request"
val CREATE_POLL = "create_poll_request"
val UPDATE_POLL = "update_poll_request"
val GET_POLLS = "get_polls_request"
val DESTROY_POLL = "destroy_poll_request"
val REMOVE_POLL = "remove_poll_request"
val SHARE_POLL = "share_poll_request"
val SHOW_POLL_RESULT = "show_poll_result_request"
val HIDE_POLL_RESULT = "hide_poll_result_request"
val START_POLL = "start_poll_request"
val STOP_POLL = "stop_poll_request"
val CLEAR_POLL = "clear_poll_request"
val GET_POLL_RESULT = "get_poll_result_request"
val RESPONT_TO_POLL = "respond_to_poll_request"
val CLEAR_PRESENTATION = "clear_presentation_request"
val REMOVE_PRESENTATION = "remove_presentation_request"
val GET_PRESENTATION_INFO = "get_presentation_info_request"
val RESIZE_AND_MOVE_SLIDE = "resize_and_move_slide_request"
val GO_TO_SLIDE = "go_to_slide_request"
val SHARE_PRESENTATION = "share_presentation_request"
val GET_SLIDE_INFO = "get_slide_info_request"
val GET_SLIDE_INFO_REPLY = "get_slide_info_reply"
val PREUPLOADED_PRESENTATIONS = "preuploaded_presentation_request"
val PRESENTATION_CONVERSION_UPDATE = "presentation_conversion_update_message"
val PRESENTATION_PAGE_COUNT_ERROR = "presentation_page_count_error_message"
val PRESENTATION_SLIDE_GENERATED = "presentation_slide_generated_message"
val PRESENTATION_CONVERSION_COMPLETED = "presentation_conversion_completed_message"
val PRESENTATION_CURSOR_UPDATED = "presentation_cursor_updated_message"
val SEND_VOICE_USERS_REQUEST = "send_voice_users_request"
val MUTE_MEETING_REQUEST = "mute_meeting_request"
val IS_MEETING_MUTED = "is_meeting_muted_request"
val MUTE_USER = "mute_user_request"
val EJECT_USER = "eject_user_request"
val VOICE_USER_JOINED_MESSAGE = "voice_user_joined_message"
val VOICE_USER_JOINED = "voice_user_joined"
val VOICE_USER_LEFT = "voice_user_left_message"
val VOICE_USER_LOCKED = "voice_user_locked_message"
val VOICE_USER_MUTED = "voice_user_muted_message"
val VOICE_USER_TALKING = "voice_user_talking_message"
val VOICE_RECORDING = "voice_recording_message"
val SEND_WHITEBOARD_ANNOTATION = "send_whiteboard_annotation_request"
val GET_WHITEBOARD_SHAPES = "get_whiteboard_shapes_request"
val CLEAR_WHITEBOARD = "clear_whiteboard_request"
val UNDO_WHITEBOARD = "undo_whiteboard_request"
val ENABLE_WHITEBOARD = "enable_whiteboard_request"
val IS_WHITEBOARD_ENABLED = "is_whiteboard_enabled_request"
val GET_STREAM_PATH = "get_stream_path_request"
val USER_REQUEST_TO_ENTER = "user_request_to_enter"
var GET_GUEST_POLICY = "get_guest_policy"
val SET_GUEST_POLICY = "set_guest_policy"
val GET_GUESTS_WAITING = "get_guests_waiting"
val RESPOND_TO_GUEST = "respond_to_guest"
val RESPOND_TO_ALL_GUESTS = "respond_to_all_guests"
val KICK_GUEST = "kick_guest"
val GET_ALL_MEETINGS_REQUEST = "get_all_meetings_request"
// OUT MESSAGES
val MEETING_CREATED = "meeting_created_message"
val VOICE_RECORDING_STARTED = "voice_recording_started_message"
val VOICE_RECORDING_STOPPED = "voice_recording_stopped_message"
val RECORDING_STATUS_CHANGED = "recording_status_changed_message"
val GET_RECORDING_STATUS_REPLY = "get_recording_status_reply"
val MEETING_ENDED = "meeting_ended_message"
val MEETING_HAS_ENDED = "meeting_has_ended_message"
val MEETING_DESTROYED = "meeting_destroyed_message"
val DISCONNECT_ALL_USERS = "disconnect_all_users_message"
val DISCONNECT_USER = "disconnect_user_message"
val PERMISSION_SETTING_INITIALIZED = "permisssion_setting_initialized_message"
val NEW_PERMISSION_SETTINGS = "new_permission_settings"
val USER_LOCKED = "user_locked_message"
val USERS_LOCKED = "users_locked_message"
val GET_PERMISSION_SETTINGS_REPLY = "get_permissions_setting_reply"
val IS_MEETING_LOCKED_REPLY = "is_meeting_locked_reply"
val USER_REGISTERED = "user_registered_message"
val USER_LEFT = "user_left_message"
val PRESENTER_ASSIGNED = "presenter_assigned_message"
val END_AND_KICK_ALL = "end_and_kick_all_message"
val GET_USERS_REPLY = "get_users_reply"
val USER_JOINED = "user_joined_message"
val USER_RAISED_HAND = "user_raised_hand_message"
val USER_LOWERED_HAND = "user_lowered_hand_message"
val USER_SHARED_WEBCAM = "user_shared_webcam_message"
val USER_UNSHARED_WEBCAM = "user_unshared_webcam_message"
val USER_STATUS_CHANGED = "user_status_changed_message"
val USER_ROLE_CHANGED = "user_role_changed_message"
val MUTE_VOICE_USER = "mute_voice_user_request"
val USER_VOICE_MUTED = "user_voice_muted_message"
val USER_VOICE_TALKING = "user_voice_talking_message"
val EJECT_VOICE_USER = "eject_voice_user_message"
val USER_JOINED_VOICE = "user_joined_voice_message"
val USER_LEFT_VOICE = "user_left_voice_message"
val IS_MEETING_MUTED_REPLY = "is_meeting_muted_reply"
val START_RECORDING = "start_recording_message"
val STOP_RECORDING = "stop_recording_message"
val GET_CHAT_HISTORY_REPLY = "get_chat_history_reply"
val SEND_PUBLIC_CHAT_MESSAGE = "send_public_chat_message"
val SEND_PRIVATE_CHAT_MESSAGE = "send_private_chat_message"
val GET_CURRENT_LAYOUT_REPLY = "get_current_layout_reply"
val SET_LAYOUT_REPLY = "set_layout_reply"
val BROADCAST_LAYOUT_REPLY = "broadcast_layout_reply"
val UNLOCK_LAYOUT_REPLY = "unlock_layout_reply"
val GET_POLL_RESULT_REPLY = "get_poll_result_reply"
val POLL_CLEARED = "poll_cleared_message"
val GET_POLLS_REPLY = "get_polls_reply"
val CLEAR_POLL_FAILED = "clear_poll_failed"
val POLL_STARTED = "poll_started_message"
val POLL_STOPPED = "poll_stopped_message"
val POLL_REMOVED = "poll_removed"
val POLL_UPDATED = "poll_updated_message"
val POLL_CREATED = "poll_created_message"
val POLL_RESPONSE = "poll_response_message"
val POLL_HIDE_RESULT = "poll_hide_result_message"
val POLL_SHOW_RESULT = "poll_show_result_message"
val PRESENTATION_CLEARED = "presentation_cleared_message"
val PRESENTATION_REMOVED = "presentation_removed_message"
val GET_PRESENTATION_INFO_REPLY = "get_presentation_info_reply"
val PRESENTATION_PAGE_RESIZED = "presentation_page_resized_message"
val PRESENTATION_PAGE_CHANGED = "presentation_page_changed_message"
val PRESENTATION_SHARED = "presentation_shared_message"
val GET_PREUPLOADED_PRESENTATIONS = "get_preuploaded_presentations_message"
val PRESENTATION_CONVERSION_PROGRESS = "presentation_conversion_progress_message"
val PRESENTATION_CONVERSION_ERROR = "presentation_conversion_error_message"
val PRESENTATION_CONVERSION_DONE = "presentation_conversion_done_message"
val PRESENTATION_CHANGED = "presentation_changed_message"
val GET_PRESENTATION_STATUS_REPLY = "get_presentation_status_reply"
val PRESENTATION_REMOVED_MESSAGE = "presentation_removed_message"
val PRESENTATION_PAGE_GENERATED = "presentation_page_generated_message"
val GET_WHITEBOARD_SHAPES_REPLY = "get_whiteboard_shapes_reply"
val SEND_WHITEBOARD_SHAPE = "send_whiteboard_shape_message"
val UNDO_WHITEBOARD_MESSAGE = "undo_whiteboard_message"
val WHITEBOARD_ENABLED = "whiteboard_enabled_message"
val WHITEBOARD_CLEARED = "whiteboard_cleared_message"
val IS_WHITEBOARD_ENABLED_REPLY = "is_whiteboard_enabled_reply"
val MEETING_DESTROYED_EVENT = "meeting_destroyed_event"
val KEEP_ALIVE_REPLY = "keep_alive_reply"
val USER_LISTEN_ONLY = "user_listening_only"
val GET_STREAM_PATH_REPLY = "get_stream_path_reply"
val GUEST_REQUESTED_TO_ENTER = "guest_requested_to_enter"
var GET_GUEST_POLICY_REPLY = "get_guest_policy_reply"
val GUEST_POLICY_CHANGED = "guest_policy_changed"
val GET_GUESTS_WAITING_REPLY = "get_guests_waiting_reply"
val RESPONSE_TO_GUEST = "response_to_guest"
val GUEST_KICKED = "guest_kicked"
val GET_ALL_MEETINGS_REPLY = "get_all_meetings_reply"
package org.bigbluebutton.core.api
object MessageNames {
val CREATE_MEETING = "create_meeting_request"
val INITIALIZE_MEETING = "initialize_meeting_request"
val DESTROY_MEETING = "destroy_meeting_request"
val START_MEETING = "start_meeting_request"
val END_MEETING = "end_meeting_request"
val LOCK_SETTING = "lock_setting_request"
val LOCK_USER = "lock_user_request"
val INIT_LOCK_SETTINGS = "init_lock_settings"
val SET_LOCK_SETTINGS = "set_lock_settings"
val GET_LOCK_SETTINGS = "get_lock_settings"
val IS_MEETING_LOCKED = "is_meeting_locked"
val VALIDATE_AUTH_TOKEN = "validate_auth_token_request"
val VALIDATE_AUTH_TOKEN_REPLY = "validate_auth_token_reply"
val REGISTER_USER = "register_user_request"
val USER_JOINING = "user_joining_request"
val USER_LEAVING = "user_leaving_request"
val GET_USERS = "get_users_request"
val RAISE_HAND = "user_raise_hand_request"
val LOWER_HAND = "user_lower_hand_request"
val USER_SHARE_WEBCAM = "user_share_webcam_request"
val USER_UNSHARE_WEBCAM = "user_unshare_webcam_request"
val CHANGE_USER_STATUS = "change_user_status_request"
val CHANGE_USER_ROLE = "change_user_role_request"
val ASSIGN_PRESENTER = "assign_presenter_request"
val SET_RECORDING_STATUS = "set_recording_status_request"
val GET_CHAT_HISTORY = "get_chat_history_request"
val SEND_PUBLIC_MESSAGE = "send_public_chat_message_request"
val SEND_PRIVATE_MESSAGE = "send_private_chat_message_request"
val GET_CURRENT_LAYOUT = "get_current_layout_request"
val SET_LAYOUT = "set_layout_request"
val BROADCAST_LAYOUT = "broadcast_layout_request"
val UNLOCK_LAYOUT = "unlock_layout_request"
val PRECREATED_POLL = "precreated_poll_request"
val CREATE_POLL = "create_poll_request"
val UPDATE_POLL = "update_poll_request"
val GET_POLLS = "get_polls_request"
val DESTROY_POLL = "destroy_poll_request"
val REMOVE_POLL = "remove_poll_request"
val SHARE_POLL = "share_poll_request"
val SHOW_POLL_RESULT = "show_poll_result_request"
val HIDE_POLL_RESULT = "hide_poll_result_request"
val START_POLL = "start_poll_request"
val STOP_POLL = "stop_poll_request"
val CLEAR_POLL = "clear_poll_request"
val GET_POLL_RESULT = "get_poll_result_request"
val RESPONT_TO_POLL = "respond_to_poll_request"
val CLEAR_PRESENTATION = "clear_presentation_request"
val REMOVE_PRESENTATION = "remove_presentation_request"
val GET_PRESENTATION_INFO = "get_presentation_info_request"
val RESIZE_AND_MOVE_SLIDE = "resize_and_move_slide_request"
val GO_TO_SLIDE = "go_to_slide_request"
val SHARE_PRESENTATION = "share_presentation_request"
val GET_SLIDE_INFO = "get_slide_info_request"
val GET_SLIDE_INFO_REPLY = "get_slide_info_reply"
val PREUPLOADED_PRESENTATIONS = "preuploaded_presentation_request"
val PRESENTATION_CONVERSION_UPDATE = "presentation_conversion_update_message"
val PRESENTATION_PAGE_COUNT_ERROR = "presentation_page_count_error_message"
val PRESENTATION_SLIDE_GENERATED = "presentation_slide_generated_message"
val PRESENTATION_CONVERSION_COMPLETED = "presentation_conversion_completed_message"
val PRESENTATION_CURSOR_UPDATED = "presentation_cursor_updated_message"
val SEND_VOICE_USERS_REQUEST = "send_voice_users_request"
val MUTE_MEETING_REQUEST = "mute_meeting_request"
val IS_MEETING_MUTED = "is_meeting_muted_request"
val MUTE_USER = "mute_user_request"
val EJECT_USER = "eject_user_request"
val VOICE_USER_JOINED_MESSAGE = "voice_user_joined_message"
val VOICE_USER_JOINED = "voice_user_joined"
val VOICE_USER_LEFT = "voice_user_left_message"
val VOICE_USER_LOCKED = "voice_user_locked_message"
val VOICE_USER_MUTED = "voice_user_muted_message"
val VOICE_USER_TALKING = "voice_user_talking_message"
val VOICE_RECORDING = "voice_recording_message"
val SEND_WHITEBOARD_ANNOTATION = "send_whiteboard_annotation_request"
val GET_WHITEBOARD_SHAPES = "get_whiteboard_shapes_request"
val CLEAR_WHITEBOARD = "clear_whiteboard_request"
val UNDO_WHITEBOARD = "undo_whiteboard_request"
val ENABLE_WHITEBOARD = "enable_whiteboard_request"
val IS_WHITEBOARD_ENABLED = "is_whiteboard_enabled_request"
val GET_STREAM_PATH = "get_stream_path_request"
var GET_GUEST_POLICY = "get_guest_policy"
val SET_GUEST_POLICY = "set_guest_policy"
val RESPOND_TO_GUEST = "respond_to_guest"
val GET_ALL_MEETINGS_REQUEST = "get_all_meetings_request"
// OUT MESSAGES
val MEETING_CREATED = "meeting_created_message"
val VOICE_RECORDING_STARTED = "voice_recording_started_message"
val VOICE_RECORDING_STOPPED = "voice_recording_stopped_message"
val RECORDING_STATUS_CHANGED = "recording_status_changed_message"
val GET_RECORDING_STATUS_REPLY = "get_recording_status_reply"
val MEETING_ENDED = "meeting_ended_message"
val MEETING_HAS_ENDED = "meeting_has_ended_message"
val MEETING_DESTROYED = "meeting_destroyed_message"
val DISCONNECT_ALL_USERS = "disconnect_all_users_message"
val DISCONNECT_USER = "disconnect_user_message"
val PERMISSION_SETTING_INITIALIZED = "permisssion_setting_initialized_message"
val NEW_PERMISSION_SETTINGS = "new_permission_settings"
val USER_LOCKED = "user_locked_message"
val USERS_LOCKED = "users_locked_message"
val GET_PERMISSION_SETTINGS_REPLY = "get_permissions_setting_reply"
val IS_MEETING_LOCKED_REPLY = "is_meeting_locked_reply"
val USER_REGISTERED = "user_registered_message"
val USER_LEFT = "user_left_message"
val PRESENTER_ASSIGNED = "presenter_assigned_message"
val END_AND_KICK_ALL = "end_and_kick_all_message"
val GET_USERS_REPLY = "get_users_reply"
val USER_JOINED = "user_joined_message"
val USER_RAISED_HAND = "user_raised_hand_message"
val USER_LOWERED_HAND = "user_lowered_hand_message"
val USER_SHARED_WEBCAM = "user_shared_webcam_message"
val USER_UNSHARED_WEBCAM = "user_unshared_webcam_message"
val USER_STATUS_CHANGED = "user_status_changed_message"
val USER_ROLE_CHANGED = "user_role_changed_message"
val MUTE_VOICE_USER = "mute_voice_user_request"
val USER_VOICE_MUTED = "user_voice_muted_message"
val USER_VOICE_TALKING = "user_voice_talking_message"
val EJECT_VOICE_USER = "eject_voice_user_message"
val USER_JOINED_VOICE = "user_joined_voice_message"
val USER_LEFT_VOICE = "user_left_voice_message"
val IS_MEETING_MUTED_REPLY = "is_meeting_muted_reply"
val START_RECORDING = "start_recording_message"
val STOP_RECORDING = "stop_recording_message"
val GET_CHAT_HISTORY_REPLY = "get_chat_history_reply"
val SEND_PUBLIC_CHAT_MESSAGE = "send_public_chat_message"
val SEND_PRIVATE_CHAT_MESSAGE = "send_private_chat_message"
val GET_CURRENT_LAYOUT_REPLY = "get_current_layout_reply"
val SET_LAYOUT_REPLY = "set_layout_reply"
val BROADCAST_LAYOUT_REPLY = "broadcast_layout_reply"
val UNLOCK_LAYOUT_REPLY = "unlock_layout_reply"
val GET_POLL_RESULT_REPLY = "get_poll_result_reply"
val POLL_CLEARED = "poll_cleared_message"
val GET_POLLS_REPLY = "get_polls_reply"
val CLEAR_POLL_FAILED = "clear_poll_failed"
val POLL_STARTED = "poll_started_message"
val POLL_STOPPED = "poll_stopped_message"
val POLL_REMOVED = "poll_removed"
val POLL_UPDATED = "poll_updated_message"
val POLL_CREATED = "poll_created_message"
val POLL_RESPONSE = "poll_response_message"
val POLL_HIDE_RESULT = "poll_hide_result_message"
val POLL_SHOW_RESULT = "poll_show_result_message"
val PRESENTATION_CLEARED = "presentation_cleared_message"
val PRESENTATION_REMOVED = "presentation_removed_message"
val GET_PRESENTATION_INFO_REPLY = "get_presentation_info_reply"
val PRESENTATION_PAGE_RESIZED = "presentation_page_resized_message"
val PRESENTATION_PAGE_CHANGED = "presentation_page_changed_message"
val PRESENTATION_SHARED = "presentation_shared_message"
val GET_PREUPLOADED_PRESENTATIONS = "get_preuploaded_presentations_message"
val PRESENTATION_CONVERSION_PROGRESS = "presentation_conversion_progress_message"
val PRESENTATION_CONVERSION_ERROR = "presentation_conversion_error_message"
val PRESENTATION_CONVERSION_DONE = "presentation_conversion_done_message"
val PRESENTATION_CHANGED = "presentation_changed_message"
val GET_PRESENTATION_STATUS_REPLY = "get_presentation_status_reply"
val PRESENTATION_REMOVED_MESSAGE = "presentation_removed_message"
val PRESENTATION_PAGE_GENERATED = "presentation_page_generated_message"
val GET_WHITEBOARD_SHAPES_REPLY = "get_whiteboard_shapes_reply"
val SEND_WHITEBOARD_SHAPE = "send_whiteboard_shape_message"
val UNDO_WHITEBOARD_MESSAGE = "undo_whiteboard_message"
val WHITEBOARD_ENABLED = "whiteboard_enabled_message"
val WHITEBOARD_CLEARED = "whiteboard_cleared_message"
val IS_WHITEBOARD_ENABLED_REPLY = "is_whiteboard_enabled_reply"
val MEETING_DESTROYED_EVENT = "meeting_destroyed_event"
val KEEP_ALIVE_REPLY = "keep_alive_reply"
val USER_LISTEN_ONLY = "user_listening_only"
val GET_STREAM_PATH_REPLY = "get_stream_path_reply"
var GET_GUEST_POLICY_REPLY = "get_guest_policy_reply"
val GUEST_POLICY_CHANGED = "guest_policy_changed"
val GUEST_ACCESS_DENIED = "guest_access_denied"
val GET_ALL_MEETINGS_REPLY = "get_all_meetings_reply"
}

View File

@ -210,13 +210,6 @@ case class UserJoined(
user:UserVO,
version:String = Versions.V_0_0_1
) extends IOutMessage
case class JoinMeetingReply(
meetingID: String,
recorded: Boolean,
user:UserVO,
version:String = Versions.V_0_0_1
) extends IOutMessage
case class UserRaisedHand(
meetingID: String,
@ -667,13 +660,6 @@ case class IsWhiteboardEnabledReply(
version:String = Versions.V_0_0_1
) extends IOutMessage
case class GuestRequestedToEnter (
meetingID: String,
recorded: Boolean,
userID: String,
name: String
) extends IOutMessage
case class GetGuestPolicyReply(
meetingID: String,
recorded: Boolean,
@ -687,24 +673,10 @@ case class GuestPolicyChanged(
policy: String
) extends IOutMessage
case class GetGuestsWaitingReply(
case class GuestAccessDenied(
meetingID: String,
recorded: Boolean,
requesterID: String,
guestsWaiting: String
) extends IOutMessage
case class ResponseToGuest(
meetingID: String,
recorded: Boolean,
guestID: String,
response: Boolean
) extends IOutMessage
case class GuestKicked(
meetingID: String,
recorded: Boolean,
guestID: String
userId: String
) extends IOutMessage
case class GetAllMeetingsReply(

View File

@ -72,6 +72,7 @@ case class UserVO(
name: String,
role: Role.Role,
guest: Boolean,
waitingForAcceptance: Boolean,
mood: String,
presenter: Boolean,
hasStream: Boolean,

View File

@ -20,8 +20,6 @@ trait UsersApp {
private var meetingMuted = false
private var currentPresenter = new Presenter("system", "system", "system")
private var guestsWaiting = new collection.immutable.ListSet[String]
def hasUser(userID: String):Boolean = {
users.hasUser(userID)
@ -273,9 +271,7 @@ trait UsersApp {
}
def handleGetUsers(msg: GetUsers):Unit = {
// Filter out guests waiting
val approvedUsers = users.getUsers.filter(x => !guestsWaiting.contains(x.userID))
outGW.send(new GetUsersReply(msg.meetingID, msg.requesterID, approvedUsers))
outGW.send(new GetUsersReply(msg.meetingID, msg.requesterID, users.getUsers))
}
def handleUserJoin(msg: UserJoining):Unit = {
@ -283,37 +279,38 @@ trait UsersApp {
regUser foreach { ru =>
val vu = new VoiceUser(msg.userID, msg.userID, ru.name, ru.name,
false, false, false, false)
val waitingForAcceptance = ru.guest && guestPolicy == GuestPolicy.ASK_MODERATOR;
val uvo = new UserVO(msg.userID, ru.externId, ru.name,
ru.role, ru.guest, mood="", presenter=false,
ru.role, ru.guest, waitingForAcceptance=waitingForAcceptance, mood="", presenter=false,
hasStream=false, locked=false, webcamStreams=new ListSet[String](),
phoneUser=false, vu, listenOnly=false, permissions)
users.addUser(uvo)
// Send UserJoined only if is not a guest or guest policy is always accept
// For guests this message will be sent when they are accepted
if(!ru.guest || guestPolicy == GuestPolicy.ALWAYS_ACCEPT) {
logger.info("User joined meeting: mid=[" + meetingID + "] uid=[" + uvo.userID + "]")
logger.info("User joined meeting: mid=[" + meetingID + "] uid=[" + uvo.userID + "]")
if (uvo.guest && guestPolicy == GuestPolicy.ALWAYS_DENY) {
outGW.send(new GuestAccessDenied(meetingID, recorded, uvo.userID))
} else {
outGW.send(new UserJoined(meetingID, recorded, uvo))
outGW.send(new MeetingState(meetingID, recorded, uvo.userID, permissions, meetingMuted))
// Become presenter if the only moderator
if (users.numModerators == 1) {
if (ru.role == Role.MODERATOR) {
assignNewPresenter(msg.userID, ru.name, msg.userID)
if (!waitingForAcceptance) {
// Become presenter if the only moderator
if (users.numModerators == 1) {
if (ru.role == Role.MODERATOR) {
assignNewPresenter(msg.userID, ru.name, msg.userID)
}
}
}
webUserJoined
startRecordingIfAutoStart()
}
outGW.send(new JoinMeetingReply(meetingID, recorded, uvo))
webUserJoined
startRecordingIfAutoStart()
}
}
def handleUserLeft(msg: UserLeaving):Unit = {
if (users.hasUser(msg.userID)) {
guestsWaiting = guestsWaiting - msg.userID
val user = users.removeUser(msg.userID)
user foreach { u =>
logger.info("User left meeting: mid=[" + meetingID + "] uid=[" + u.userID + "]")
@ -339,14 +336,13 @@ trait UsersApp {
msg.voiceUser.callerName, msg.voiceUser.callerNum,
true, false, false, false)
val uvo = new UserVO(webUserId, webUserId, msg.voiceUser.callerName,
Role.VIEWER, guest=false, mood="", presenter=false,
Role.VIEWER, guest=false, waitingForAcceptance=false, mood="", presenter=false,
hasStream=false, locked=false, webcamStreams=new ListSet[String](),
phoneUser=true, vu, listenOnly=false, permissions)
users.addUser(uvo)
logger.info("New user joined voice for user [" + uvo.name + "] userid=[" + msg.voiceUser.webUserId + "]")
outGW.send(new UserJoined(meetingID, recorded, uvo))
outGW.send(new JoinMeetingReply(meetingID, recorded, uvo))
outGW.send(new UserJoinedVoice(meetingID, recorded, voiceBridge, uvo))
if (meetingMuted)
@ -442,61 +438,31 @@ trait UsersApp {
}
}
def handleUserRequestToEnter(msg: UserRequestToEnter) {
users.getUser(msg.userID) match {
case Some(user) => {
guestsWaiting = guestsWaiting + msg.userID;
outGW.send(new GuestRequestedToEnter(meetingID, recorded, msg.userID, user.name))
}
case None => {
// println("handleUserRequestToEnter user [" + msg.userId + "] not found.")
}
}
}
def handleGetGuestsWaiting(msg: GetGuestsWaiting) {
if(users.hasUser(msg.requesterID)) {
var message = "";
guestsWaiting foreach {guest => {
users.getUser(guest) match {
case Some(user) => message = message + user.userID + ":" + user.name + ","
case None => {}
}
}}
outGW.send(new GetGuestsWaitingReply(meetingID, recorded, msg.requesterID, message))
private def isModerator(userId: String):Boolean = {
users.getUser(userId) match {
case Some(user) => return user.role == Role.MODERATOR && !user.waitingForAcceptance
case None => return false
}
}
def handleRespondToGuest(msg: RespondToGuest) {
if(guestsWaiting.contains(msg.guestID)) {
guestsWaiting = guestsWaiting - msg.guestID
outGW.send(new ResponseToGuest(meetingID, recorded, msg.guestID, msg.response))
if(msg.response == true) {
users.getUser(msg.guestID) foreach {user =>
println("UsersApp - handleResponseToGuest sending userJoined["+user.userID+"]");
outGW.send(new UserJoined(meetingID, recorded, user))
outGW.send(new MeetingState(meetingID, recorded, user.userID, permissions, meetingMuted))
if (isModerator(msg.requesterID)) {
var usersToAnswer:Array[UserVO] = null;
if (msg.userId == null) {
usersToAnswer = users.getUsers.filter(u => u.waitingForAcceptance == true)
} else {
usersToAnswer = users.getUsers.filter(u => u.waitingForAcceptance == true && u.userID == msg.userId)
}
usersToAnswer foreach {user =>
println("UsersApp - handleGuestAccessDenied for user [" + user.userID + "]");
if (msg.response == true) {
val nu = user.copy(waitingForAcceptance=false)
users.addUser(nu)
outGW.send(new UserJoined(meetingID, recorded, nu))
} else {
outGW.send(new GuestAccessDenied(meetingID, recorded, user.userID))
}
}
}
}
def handleRespondToAllGuests(msg: RespondToAllGuests) {
guestsWaiting foreach {guest =>
if(msg.response == true) {
users.getUser(guest) foreach {user =>
println("UsersApp - handleResponseToGuest sending userJoined["+user.userID+"]");
outGW.send(new UserJoined(meetingID, recorded, user))
outGW.send(new MeetingState(meetingID, recorded, user.userID, permissions, meetingMuted))
}
}
outGW.send(new ResponseToGuest(meetingID, recorded, guest, msg.response))
}
guestsWaiting = new collection.immutable.ListSet[String]
}
def handleKickGuest(msg: KickGuest) {
guestsWaiting = guestsWaiting - msg.guestID;
outGW.send(new GuestKicked(meetingID, recorded, msg.guestID))
}
}

View File

@ -23,7 +23,6 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
case msg: DisconnectUser => handleDisconnectUser(msg)
case msg: PresenterAssigned => handleAssignPresenter(msg)
case msg: UserJoined => handleUserJoined(msg)
case msg: JoinMeetingReply => handleJoinMeetingReply(msg)
case msg: UserLeft => handleUserLeft(msg)
case msg: UserStatusChange => handleUserStatusChange(msg)
case msg: UserRoleChange => handleUserRoleChange(msg)
@ -42,12 +41,9 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
case msg: NewPermissionsSetting => handleNewPermissionsSetting(msg)
case msg: MeetingMuted => handleMeetingMuted(msg)
case msg: MeetingState => handleMeetingState(msg)
case msg: GuestRequestedToEnter => handleGuestRequestedToEnter(msg)
case msg: GetGuestPolicyReply => handleGetGuestPolicyReply(msg)
case msg: GuestPolicyChanged => handleGuestPolicyChanged(msg)
case msg: GetGuestsWaitingReply => handleGetGuestsWaitingReply(msg)
case msg: ResponseToGuest => handleResponseToGuest(msg)
case msg: GuestKicked => handleGuestKicked(msg)
case msg: GuestAccessDenied => handleGuestAccessDenied(msg)
case _ => // println("Unhandled message in UsersClientMessageSender")
}
@ -81,6 +77,7 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
wuser.put("name", user.name)
wuser.put("role", user.role.toString())
wuser.put("guest", user.guest:java.lang.Boolean)
wuser.put("waitingForAcceptance", user.waitingForAcceptance:java.lang.Boolean)
wuser.put("mood", user.mood:java.lang.String)
wuser.put("presenter", user.presenter:java.lang.Boolean)
wuser.put("hasStream", user.hasStream:java.lang.Boolean)
@ -354,25 +351,19 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - joinMeetingReply \n" + message.get("msg") + "\n")
var jmr = new DirectClientMessage(msg.meetingID, msg.user.userID, "joinMeetingReply", message);
service.sendMessage(jmr);
// println("UsersClientMessageSender - handleUserJoined \n" + message.get("msg") + "\n")
var m = new BroadcastClientMessage(msg.meetingID, "participantJoined", message);
service.sendMessage(m);
}
private def handleJoinMeetingReply(msg: JoinMeetingReply):Unit = {
var args = new HashMap[String, Object]();
args.put("user", buildUserHashMap(msg.user));
val message = new java.util.HashMap[String, Object]()
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - joinMeetingReply \n" + message.get("msg") + "\n")
var jmr = new DirectClientMessage(msg.meetingID, msg.user.userID, "joinMeetingReply", message);
service.sendMessage(jmr);
}
private def handleUserLeft(msg: UserLeft):Unit = {
var args = new HashMap[String, Object]();
args.put("user", buildUserHashMap(msg.user));
@ -463,21 +454,6 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
service.sendMessage(m);
}
private def handleGuestRequestedToEnter(msg: GuestRequestedToEnter) {
var args = new HashMap[String, Object]();
args.put("userId", msg.userID);
args.put("name", msg.name);
val message = new java.util.HashMap[String, Object]()
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - handleGuestRequestedToEnter \n" + message.get("msg") + "\n")
var m = new BroadcastClientMessage(msg.meetingID, "user_requested_to_enter", message);
service.sendMessage(m);
}
private def handleGetGuestPolicyReply(msg: GetGuestPolicyReply) {
var args = new HashMap[String, Object]();
args.put("guestPolicy", msg.policy.toString());
@ -506,46 +482,17 @@ class UsersClientMessageSender(service: ConnectionInvokerService) extends OutMes
service.sendMessage(m);
}
private def handleGetGuestsWaitingReply(msg: GetGuestsWaitingReply) {
private def handleGuestAccessDenied(msg: GuestAccessDenied) {
var args = new HashMap[String, Object]();
args.put("guestsWaiting", msg.guestsWaiting);
args.put("userId", msg.userId);
val message = new java.util.HashMap[String, Object]()
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - handleGetGuestsWaitingReply \n" + message.get("msg") + "\n")
// println("UsersClientMessageSender - handleGuestAccessDenied \n" + message.get("msg") + "\n")
val m = new DirectClientMessage(msg.meetingID, msg.requesterID, "get_guests_waiting_reply", message);
service.sendMessage(m);
}
private def handleResponseToGuest(msg: ResponseToGuest) {
var args = new HashMap[String, Object]();
args.put("userId", msg.guestID);
args.put("response", msg.response:java.lang.Boolean);
val message = new java.util.HashMap[String, Object]()
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - handleResponseToGuest \n" + message.get("msg") + "\n")
val m = new BroadcastClientMessage(msg.meetingID, "response_to_guest", message);
service.sendMessage(m);
}
private def handleGuestKicked(msg: GuestKicked) {
var args = new HashMap[String, Object]();
args.put("guestId", msg.guestID);
val message = new java.util.HashMap[String, Object]()
val gson = new Gson();
message.put("msg", gson.toJson(args))
// println("UsersClientMessageSender - handleGuestKicked \n" + message.get("msg") + "\n")
val m = new BroadcastClientMessage(msg.meetingID, "guest_kicked", message);
val m = new DirectClientMessage(msg.meetingID, msg.userId, "guest_access_denied", message);
service.sendMessage(m);
}
}

View File

@ -17,6 +17,7 @@ object UsersMessageToJsonConverter {
wuser += "name" -> user.name
wuser += "role" -> user.role.toString()
wuser += "guest" -> user.guest
wuser += "waiting_for_acceptance" -> user.waitingForAcceptance
wuser += "mood" -> user.mood
wuser += "presenter" -> user.presenter
wuser += "has_stream" -> user.hasStream

View File

@ -181,17 +181,6 @@ package org.bigbluebutton.core
}
return null;
}
public static function amIGuest(): Boolean {
return UserManager.getInstance().getConference().amIGuest();
}
public static function amIWaitForModerator(): Boolean {
return UserManager.getInstance().getConference().amIWaitForModerator();
}
public static function setWaitForModerator(state: Boolean): void {
UserManager.getInstance().getConference().setWaitForModerator(state);
}
}
}
}

View File

@ -64,13 +64,13 @@ package org.bigbluebutton.core.managers
connDelegate.sendMessage(service, onSuccess, onFailure, message);
}
public function forceClose():void {
connDelegate.forceClose();
}
public function forceClose():void {
connDelegate.forceClose();
}
public function guestDisconnect():void {
connDelegate.guestDisconnect();
}
public function guestDisconnect():void {
connDelegate.guestDisconnect();
}
}
}

View File

@ -64,7 +64,7 @@ package org.bigbluebutton.core.model
guest = value;
return this;
}
public function withCustomData(value: Object):MeBuilder {
customData = value;
return this;
@ -74,4 +74,4 @@ package org.bigbluebutton.core.model
return new Me(this);
}
}
}
}

View File

@ -47,7 +47,7 @@ package org.bigbluebutton.core.model.users
public function withGuest(value: Boolean):UserBuilder {
return this;
}
public function withCustomData(value: String):UserBuilder {
return this;
}
@ -57,4 +57,4 @@ package org.bigbluebutton.core.model.users
}
}
}
}

View File

@ -1,36 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.events
{
import flash.events.Event;
public class AddGuestEvent extends Event
{
public static const ADD_GUEST:String = "AddGuest";
public var userid:String;
public var name:String;
public function AddGuestEvent(type:String = ADD_GUEST)
{
super(type, true, false);
}
}
}

View File

@ -31,7 +31,7 @@ package org.bigbluebutton.main.events {
public static const VIDEO_STARTED:String = 'BBB_VIDEO_STARTED';
public static const START_DESKSHARE:String = 'BBB_START_DESKSHARE';
public static const DESKSHARE_STARTED:String = 'BBB_DESKSHARE_STARTED';
public static const USER_VOICE_JOINED:String = 'user voice joined event';
public static const USER_VOICE_JOINED:String = 'user voice joined event';
public static const USER_VOICE_MUTED:String = "user voice muted event";
public static const USER_LOCKED:String = "user locked event";
public static const USER_VOICE_LEFT:String = "user voice left event";
@ -45,18 +45,16 @@ package org.bigbluebutton.main.events {
public static const SETTINGS_CONFIRMED:String = "BBB_SETTINGS_CONFIRMED";
public static const SETTINGS_CANCELLED:String = "BBB_SETTINGS_CANCELLED";
public static const ACCEPT_ALL_WAITING_GUESTS:String = "BBB_ACCEPT_ALL_WAITING_GUESTS";
public static const DENY_ALL_WAITING_GUESTS:String = "BBB_DENY_ALL_WAITING_GUESTS";
public static const DENY_GUEST:String = "BBB_DENY_GUEST";
public static const ACCEPT_GUEST:String = "BBB_ACCEPT_GUEST";
public static const ASK_TO_ACCEPT_GUEST:String = "BBB_ASK_TO_ACCEPT_GUEST";
public static const BROADCAST_GUEST_POLICY:String = "BBB_BROADCAST_GUEST_POLICY";
public static const RETRIEVE_GUEST_POLICY:String = "BBB_RETRIEVE_GUEST_POLICY";
public static const KICK_GUEST:String = "KICK_GUEST";
public static const MODERATOR_ALLOWED_ME_TO_JOIN:String = "MODERATOR_ALLOWED_ME_TO_JOIN";
public static const WAITING_FOR_MODERATOR_ACCEPTANCE:String = "WAITING_FOR_MODERATOR_ACCEPTANCE";
public static const ADD_GUEST_TO_LIST:String = "ADD_GUEST_TO_LIST";
public static const REMOVE_GUEST_FROM_LIST:String = "REMOVE_GUEST_FROM_LIST";
public var message:String;
public var payload:Object = new Object();
@ -65,4 +63,4 @@ package org.bigbluebutton.main.events {
this.message = message;
}
}
}
}

View File

@ -25,7 +25,7 @@ package org.bigbluebutton.main.events
public static const USER_LOGGED_OUT:String = "USER_LOGGED_OUT";
public static const DISCONNECT_TEST:String = "disconnect_test";
public static const USER_KICKED_OUT:String = "USER_KICKED_OUT";
public static const GUEST_KICKED_OUT:String = "GUEST_KICKED_OUT";
public static const MODERATOR_DENIED_ME:String = "MODERATOR_DENIED_ME";
public static const CONFIRM_LOGOUT:String = "CONFIRM_LOGOUT";
public static const REFOCUS_CONFIRM:String = "REFOCUS_CONFIRM";

View File

@ -1,32 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.events
{
import flash.events.Event;
public class ModeratorRespEvent extends Event
{
public static const GUEST_ALLOWED:String = "GuestAllowed";
public function ModeratorRespEvent(type:String)
{
super(type, true, false);
}
}
}

View File

@ -1,40 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.events
{
import flash.events.Event;
import org.bigbluebutton.main.model.users.BBBUser;
public class NewGuestEvent extends Event
{
public static const NEW_GUEST_EVENT:String = "NewGuestEvent";
public var userid:String;
public var name:String;
public function NewGuestEvent(type:String)
{
super(type, true, false);
}
}
}

View File

@ -1,38 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.events
{
import flash.events.Event;
public class RemoveGuestRequestEvent extends Event
{
public static const GUEST_EVENT:String = "GuestEvent";
public var userid:String;
public function RemoveGuestRequestEvent(type:String)
{
super(type, true, false);
}
}
}

View File

@ -1,36 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2010 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 <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.events
{
import flash.events.Event;
import org.bigbluebutton.main.model.ConferenceParameters;
public class WaitModeratorEvent extends Event
{
public static const USER_LOGGED_IN:String = "UserLoggedIn";
public var conferenceParameters:ConferenceParameters;
public function WaitModeratorEvent(type:String)
{
super(type, true, false);
}
}
}

View File

@ -48,11 +48,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<EventHandlers type="{SuccessfulLoginEvent.USER_LOGGED_IN}" >
<MethodInvoker generator="{ModulesProxy}" method="loadAllModules" arguments="{event.conferenceParameters}" />
</EventHandlers>
<EventHandlers type="{LogoutEvent.USER_LOGGED_OUT}" >
<MethodInvoker generator="{ModulesProxy}" method="handleLogout" />
</EventHandlers>
<EventHandlers type="{ConfigEvent.CONFIG_EVENT}" >
<MethodInvoker generator="{ConfigManager}" method="setConfig" arguments="{event.config}" />
<MethodInvoker generator="{SkinningService}" method="loadSkins" arguments="{event.config.skinning}" />
@ -66,10 +66,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{ModulesProxy}" method="startAllModules" />
</EventHandlers>
<EventHandlers type="{LogoutEvent.GUEST_KICKED_OUT}" >
<EventHandlers type="{LogoutEvent.MODERATOR_DENIED_ME}" >
<MethodInvoker generator="{ModulesProxy}" method="handleLogout" />
</EventHandlers>
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
@ -85,7 +86,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.model.PortTestProxy;
import org.bigbluebutton.main.model.modules.ModulesProxy;
]]>
</mx:Script>

View File

@ -105,4 +105,4 @@ package org.bigbluebutton.main.model
* */
public var lockSettings:Object;
}
}
}

View File

@ -21,8 +21,8 @@ package org.bigbluebutton.main.model
{
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.RefreshGuestEvent;
import org.bigbluebutton.main.events.AddGuestEvent;
import org.bigbluebutton.main.events.RemoveGuestFromViewEvent;
public class GuestManager
@ -35,8 +35,8 @@ package org.bigbluebutton.main.model
this.guest = new Guest();
}
public function addGuest(evt:AddGuestEvent):void {
guest.addGuest(evt.userid, evt.name);
public function addGuest(evt:BBBEvent):void {
guest.addGuest(evt.payload.userId, evt.payload.name);
refreshGuestView();
}

View File

@ -30,4 +30,4 @@ package org.bigbluebutton.main.model
public var authToken:String;
public var guest:Boolean;
}
}
}

View File

@ -54,9 +54,8 @@ package org.bigbluebutton.main.model.users
[Bindable] public var disableMyPublicChat:Boolean = false;
[Bindable] public var lockedLayout:Boolean = false;
[Bindable] public var waitingForMod:Boolean = false;
[Bindable] public var guest:Boolean;
[Bindable] public var acceptedJoin:Boolean = false;
[Bindable] public var guest:Boolean = false;
[Bindable] public var waitingForAcceptance:Boolean = false;
[Bindable]
public function get hasStream():Boolean {

View File

@ -110,15 +110,13 @@ package org.bigbluebutton.main.model.users {
public function addUser(newuser:BBBUser):void {
trace("Adding new user [" + newuser.userID + "]");
if (! hasUser(newuser.userID)) {
trace("Am I this new user [" + newuser.userID + ", " + me.userID + "]");
if (newuser.userID == me.userID) {
newuser.me = true;
}
users.addItem(newuser);
users.refresh();
}
removeUserHelper(newuser.userID);
if (newuser.userID == me.userID) {
newuser.me = true;
}
users.addItem(newuser);
users.refresh();
}
public function setCamPublishing(publishing:Boolean):void {
@ -140,14 +138,6 @@ package org.bigbluebutton.main.model.users {
public function getDefaultLayout():String {
return defaultLayout;
}
public function amIWaitForModerator():Boolean {
return me.waitingForMod;
}
public function setWaitForModerator(state:Boolean):void {
me.waitingForMod = state;
}
public function hasUser(userID:String):Boolean {
var p:Object = getUserIndex(userID);
@ -227,15 +217,23 @@ package org.bigbluebutton.main.model.users {
var a:BBBUser = user.participant as BBBUser;
return a.presenter;
}
public function removeUser(userID:String):void {
private function removeUserHelper(userID:String):BBBUser {
var p:Object = getUserIndex(userID);
if (p != null) {
trace("removing user[" + p.participant.name + "," + p.participant.userID + "]");
users.removeItemAt(p.index);
//sort();
return p.participant as BBBUser;
} else {
return null;
}
}
public function removeUser(userID:String):void {
var p:Object = removeUserHelper(userID);
if (p != null) {
trace("removing user[" + p.name + "," + p.userID + "]");
users.refresh();
}
}
}
/**

View File

@ -158,4 +158,4 @@ package org.bigbluebutton.main.model.users
return this.urlLoader;
}
}
}
}

View File

@ -31,7 +31,7 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.main.events.InvalidAuthTokenEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.users.events.ConnectionFailedEvent;
import org.bigbluebutton.main.model.users.events.UsersConnectionEvent;
import org.bigbluebutton.main.model.users.events.UsersConnectionEvent;
public class NetConnectionDelegate
{
@ -228,11 +228,12 @@ package org.bigbluebutton.main.model.users
this.guestKickedOutCommand = true;
_netConnection.close();
}
public function forceClose():void {
_netConnection.close();
}
public function forceClose():void {
_netConnection.close();
}
protected function netStatus(event:NetStatusEvent):void {
handleResult( event );
}
@ -337,7 +338,7 @@ package org.bigbluebutton.main.model.users
sendUserLoggedOutEvent();
return;
}
var e:ConnectionFailedEvent = new ConnectionFailedEvent(reason);
dispatcher.dispatchEvent(e);
@ -350,7 +351,7 @@ package org.bigbluebutton.main.model.users
}
private function sendGuestUserKickedOutEvent():void {
var e:ConnectionFailedEvent = new ConnectionFailedEvent(ConnectionFailedEvent.GUEST_KICKED_OUT);
var e:ConnectionFailedEvent = new ConnectionFailedEvent(ConnectionFailedEvent.MODERATOR_DENIED_ME);
dispatcher.dispatchEvent(e);
}

View File

@ -36,13 +36,12 @@ package org.bigbluebutton.main.model.users
import org.bigbluebutton.core.managers.ConnectionManager;
import org.bigbluebutton.core.managers.UserConfigManager;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.model.Config
import org.bigbluebutton.core.model.Config;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.events.WaitModeratorEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.events.ResponseModeratorEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.model.ConferenceParameters;
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
@ -72,6 +71,15 @@ package org.bigbluebutton.main.model.users
public function UserService() {
dispatcher = new Dispatcher();
msgReceiver.onAllowedToJoin = function():void {
sender.queryForParticipants();
sender.queryForRecordingStatus();
sender.queryForGuestPolicy();
var loadCommand:SuccessfulLoginEvent = new SuccessfulLoginEvent(SuccessfulLoginEvent.USER_LOGGED_IN);
loadCommand.conferenceParameters = _conferenceParameters;
dispatcher.dispatchEvent(loadCommand);
}
}
public function startService(e:UserServicesEvent):void {
@ -207,50 +215,20 @@ package org.bigbluebutton.main.model.users
trace(LOG + "userLoggedIn - Setting my userid to [" + e.userid + "]");
UserManager.getInstance().getConference().setMyUserid(e.userid);
_conferenceParameters.userid = e.userid;
sender.queryForParticipants();
sender.queryForRecordingStatus();
sender.queryForGuestPolicy();
if(UsersUtil.amIGuest() == false) {
var loadCommand:SuccessfulLoginEvent = new SuccessfulLoginEvent(SuccessfulLoginEvent.USER_LOGGED_IN);
loadCommand.conferenceParameters = _conferenceParameters;
dispatcher.dispatchEvent(loadCommand);
}
}
public function askToAccept():void {
UserManager.getInstance().getConference().setWaitForModerator(true);
var guestCommand:WaitModeratorEvent = new WaitModeratorEvent(WaitModeratorEvent.USER_LOGGED_IN);
guestCommand.conferenceParameters = _conferenceParameters;
dispatcher.dispatchEvent(guestCommand);
}
public function acceptGuest():void {
var loadCommand:SuccessfulLoginEvent = new SuccessfulLoginEvent(SuccessfulLoginEvent.USER_LOGGED_IN);
loadCommand.conferenceParameters = _conferenceParameters;
dispatcher.dispatchEvent(loadCommand);
}
public function denyGuest():void {
dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.GUEST_KICKED_OUT));
dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.MODERATOR_DENIED_ME));
}
public function newGuestPolicy(event:BBBEvent):void {
public function setGuestPolicy(event:BBBEvent):void {
sender.setGuestPolicy(event.payload['guestPolicy']);
}
public function getAllGuests(e:SuccessfulLoginEvent):void {
if(UserManager.getInstance().getConference().amIModerator()) {
sender.queryForGuestsWaiting();
}
}
public function guestDisconnect():void {
_connectionManager.guestDisconnect();
}
public function isModerator():Boolean {
return UserManager.getInstance().getConference().amIModerator();
}
@ -270,22 +248,10 @@ package org.bigbluebutton.main.model.users
public function changeStatus(e:ChangeStatusEvent):void {
sender.changeStatus(e.userId, e.getStatusName());
}
public function askToEnter(e:WaitModeratorEvent):void {
sender.askToEnter();
}
public function responseToGuest(e:ResponseModeratorEvent):void {
sender.responseToGuest(e.userid, e.resp);
}
public function responseToAllGuests(e:ResponseModeratorEvent):void {
sender.responseToAllGuests(e.resp);
}
public function kickGuest(e:BBBEvent):void {
sender.kickGuest(e.payload.userId);
}
public function kickUser(e:KickUserEvent):void{
if (this.isModerator()) sender.kickUser(e.userid);

View File

@ -30,11 +30,11 @@ package org.bigbluebutton.main.model.users.events
public static const CONNECTION_REJECTED:String = "connectionRejected";
public static const ASYNC_ERROR:String = "asyncError";
public static const USER_LOGGED_OUT:String = "userHasLoggedOut";
public static const GUEST_KICKED_OUT:String = "guestKickedOut";
public static const MODERATOR_DENIED_ME:String = "moderatorDeniedMe";
public function ConnectionFailedEvent(type:String)
{
super(type, true, false);
}
}
}
}

View File

@ -25,12 +25,10 @@ package org.bigbluebutton.main.model.users.events
{
public static const CONNECTION_SUCCESS:String = "usersConnectionSuccess";
public var connection:NetConnection;
public var userid:String;
public var guest:Boolean;
public var userid:String;
public function UsersConnectionEvent(type:String) {
super(type, true, false);
}
}
}
}

View File

@ -118,7 +118,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
redirect(); // we know that the disconnect was requested so automatically redirect
break;
case ConnectionFailedEvent.GUEST_KICKED_OUT:
case ConnectionFailedEvent.MODERATOR_DENIED_ME:
message = ResourceUtil.getInstance().getString('bbb.logout.guestkickedout');
setCurrentState(DISPLAY_MESSAGE_ONLY_STATE);
break;

View File

@ -63,11 +63,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{NetworkStatsEvent.OPEN_NETSTATS_WIN}" method="openNetworkStatsWindow" />
<mate:Listener type="{BBBEvent.RETRIEVE_GUEST_POLICY}" method="setGuestPolicy"/>
<mate:Listener type="{ConnectionFailedEvent.GUEST_KICKED_OUT}" method="handleLogout" />
<mate:Listener type="{ModeratorRespEvent.GUEST_ALLOWED}" method="guestAllowed" />
<mate:Listener type="{ConnectionFailedEvent.MODERATOR_DENIED_ME}" method="handleLogout" />
<mate:Listener type="{BBBEvent.MODERATOR_ALLOWED_ME_TO_JOIN}" method="guestAllowed" />
<mate:Listener type="{RefreshGuestEvent.REFRESH_GUEST_VIEW}" method="refreshGuestView" />
<mate:Listener type="{RemoveGuestRequestEvent.GUEST_EVENT}" method="removeGuestWindow" />
<mate:Listener type="{WaitModeratorEvent.USER_LOGGED_IN}" method="openWaitWindow" />
<mate:Listener type="{BBBEvent.REMOVE_GUEST_FROM_LIST}" method="removeGuestWindow" />
<mate:Listener type="{BBBEvent.WAITING_FOR_MODERATOR_ACCEPTANCE}" method="openWaitWindow" />
<mx:Script>
<![CDATA[
@ -97,6 +97,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.common.events.SettingsComponentEvent;
import org.bigbluebutton.common.events.ToolbarButtonEvent;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.events.LockControlEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.core.vo.LockSettingsVO;
@ -108,14 +109,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import org.bigbluebutton.main.events.MeetingNotFoundEvent;
import org.bigbluebutton.main.events.ModeratorRespEvent;
import org.bigbluebutton.main.events.ModuleLoadEvent;
import org.bigbluebutton.main.events.PortTestEvent;
import org.bigbluebutton.main.events.RefreshGuestEvent;
import org.bigbluebutton.main.events.RemoveGuestRequestEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.events.WaitModeratorEvent;
import org.bigbluebutton.main.model.Guest;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.users.Conference;
@ -385,7 +383,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new ModuleLoadEvent(ModuleLoadEvent.START_ALL_MODULES));
}
public function guestAllowed(evt:BBBEvent):void {
progressBar.visible = true;
if (waitWindow != null) {
PopUpManager.removePopUp(waitWindow);
waitWindow = null;
}
}
private function fullScreenHandler(evt:FullScreenEvent):void {
if (evt.fullScreen) {
LogUtil.debug("Switching to full screen");
@ -396,13 +402,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
fullscreen_icon = images.full_screen;
showToolbars();
}
}
public function guestAllowed(evt:ModeratorRespEvent):void {
progressBar.visible = true;
waitWindow.guestAllowed();
}
}
private function closeGuestWindow(e:Event):void {
if(guestWindow != null) {
guestWindow.closeWindow();
@ -411,8 +412,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function refreshGuestView(evt:RefreshGuestEvent):void {
LogUtil.debug("REFRESH GUEST");
if(guestWindow == null) {
// do not show the guest window if the user isn't moderator or if he's moderator but is still waiting for acceptance
if ( ! (
UsersUtil.amIModerator()
&& UserManager.getInstance().getConference().getMyUser() != null
&& !UserManager.getInstance().getConference().getMyUser().waitingForAcceptance) ) {
return;
}
if (guestWindow == null) {
guestWindow = PopUpManager.createPopUp( mdiCanvas, GuestWindow, false) as GuestWindow;
guestWindow.addEventListener(Event.CLOSE, closeGuestWindow);
@ -422,15 +430,15 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
guestWindow.refreshGuestView(evt.listOfGuests);
}
public function removeGuestWindow(evt:RemoveGuestRequestEvent):void {
if(guestWindow != null)
guestWindow.remove(evt.userid);
public function removeGuestWindow(evt:BBBEvent):void {
if (guestWindow != null) {
guestWindow.remove(evt.payload.userId);
}
}
private function openWaitWindow(evt:WaitModeratorEvent):void {
private function openWaitWindow(evt:BBBEvent):void {
progressBar.visible = false;
waitWindow = PopUpManager.createPopUp( mdiCanvas, WaitingWindow, false) as WaitingWindow;
waitWindow.conferenceParameters = evt.conferenceParameters;
// Calculate position of TitleWindow in Application's coordinates.
waitWindow.x = (systemManager.screen.width - waitWindow.width) / 2;

View File

@ -37,18 +37,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{ShortcutEvent.FOCUS_SHORTCUT_BUTTON}" method="focusShortcutButton" />
<mate:Listener type="{ShortcutEvent.FOCUS_LOGOUT_BUTTON}" method="focusLogoutButton" />
<mate:Listener type="{ConferenceCreatedEvent.CONFERENCE_CREATED_EVENT}" method="retrieveMeetingName" />
<mate:Listener type="{ConnectionFailedEvent.GUEST_KICKED_OUT}" method="hideToolbar" />
<mate:Listener type="{ConnectionFailedEvent.MODERATOR_DENIED_ME}" method="hideToolbar" />
<mate:Listener type="{SettingsComponentEvent.ADD}" method="addSettingsComponent" />
<mate:Listener type="{SettingsComponentEvent.REMOVE}" method="removeSettingsComponent"/>
<mate:Listener type="{BBBEvent.CHANGE_RECORDING_STATUS}" method="onRecordingStatusChanged" />
<mate:Listener type="{WaitModeratorEvent.USER_LOGGED_IN}" method="refreshSettingsBtn" />
<mate:Listener type="{ModeratorRespEvent.GUEST_ALLOWED}" method="refreshSettingsBtn" />
<mate:Listener type="{SuccessfulLoginEvent.USER_LOGGED_IN}" method="refreshModeratorButtonsVisibility" />
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.accessibility.AlertAccImpl;
import mx.binding.utils.BindingUtils;
import mx.controls.Alert;
import mx.core.IToolTip;
import mx.core.UIComponent;
@ -68,12 +68,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ConfigEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.ModeratorRespEvent;
import org.bigbluebutton.main.events.NetworkStatsEvent;
import org.bigbluebutton.main.events.SettingsEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.events.WaitModeratorEvent;
import org.bigbluebutton.main.model.LayoutOptions;
import org.bigbluebutton.main.model.NetworkStatsData;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
@ -88,8 +86,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
[Bindable] private var showHelpBtn:Boolean = false;
[Bindable] private var showToolbar:Boolean = false;
[Bindable] private var showConfigurationsButton:Boolean = false;
[Bindable] public var toolbarOptions:LayoutOptions = new LayoutOptions();
[Bindable] private var showGuestSettingsButton:Boolean = false;
[Bindable] private var showRecordButton:Boolean = false;
[Bindable] public var toolbarOptions:LayoutOptions = new LayoutOptions();
[Bindable] private var baseIndex:int;
[Bindable] private var numButtons:int;
@ -109,7 +108,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var xml:XML;
private var settingsComponents:Array = new Array();
private var settingsPopup:BBBSettings = null;
private function init():void{
if (Capabilities.hasAccessibility) {
AlertAccImpl.enableAccessibility();
@ -123,8 +122,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
timer.addEventListener(TimerEvent.TIMER, checkAccessiblity);
timer.start();
BindingUtils.bindSetter(refreshModeratorButtonsVisibility, UserManager.getInstance().getConference(), "record");
}
private function onCreationComplete():void {
@ -182,23 +180,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
initBandwidthToolTip();
}
}
private function retrieveMeetingName(e:ConferenceCreatedEvent):void {
if (toolbarOptions.showMeetingName) {
var meetingTitle:String = BBB.initUserConfigManager().getMeetingTitle();
var meetingTitle:String = BBB.initUserConfigManager().getMeetingTitle();
if (meetingTitle != null) {
meetingNameLbl.text = meetingTitle;
}
}
}
// need to put it here because on init() the conference object
// still doesn't have the updated information
refreshSettingsBtn(null);
}
private function refreshSettingsBtn(e:*):void {
showConfigurationsButton = UsersUtil.amIModerator() && !UsersUtil.amIWaitForModerator();
}
private function refreshModeratorButtonsVisibility(e:*):void {
showGuestSettingsButton = UsersUtil.amIModerator()
&& UserManager.getInstance().getConference().getMyUser() != null
&& !UserManager.getInstance().getConference().getMyUser().waitingForAcceptance;
showRecordButton = showGuestSettingsButton && UserManager.getInstance().getConference().record;
}
public function addButton(name:String):Button{
var btn:Button = new Button();
btn.id = name;
@ -430,7 +429,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function refreshRole(e:ChangeMyRole):void {
refreshSettingsBtn(null);
refreshModeratorButtonsVisibility(null);
}
]]>
</mx:Script>
@ -452,7 +451,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
tabIndex="{baseIndex+4}" height="22" styleName="quickWindowLinkStyle" />
</mx:HBox>
<mx:HBox id="addedBtns"/>
<views:RecordButton id="recordBtn" tabIndex="{baseIndex+numButtons+10}" />
<views:RecordButton id="recordBtn" visible="{showRecordButton}" includeInLayout="{showRecordButton}" tabIndex="{baseIndex+numButtons+10}" />
<mx:VRule strokeWidth="2" height="100%" visible="{muteMeBtn.visible}" includeInLayout="{muteMeBtn.includeInLayout}"/>
<views:MuteMeButton id="muteMeBtn" height="20" tabIndex="{baseIndex+numButtons+11}"/>
<mx:Spacer width="50%"/>
@ -461,8 +460,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Button
id="bbbSettings"
visible="{showConfigurationsButton}"
includeInLayout="{showConfigurationsButton}"
visible="{showGuestSettingsButton}"
includeInLayout="{showGuestSettingsButton}"
toolTip="{ResourceUtil.getInstance().getString('bbb.settings.btn.toolTip')}"
click="onSettingsButtonClick()"
styleName="settingsButtonStyle"

View File

@ -31,8 +31,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
: ResourceUtil.getInstance().getString('bbb.mainToolbar.recordBtn.toolTip.notRecording')}"
enabled="false"
creationComplete="onCreationComplete()"
visible="{UserManager.getInstance().getConference().record}"
includeInLayout="{UserManager.getInstance().getConference().record}"
mouseOver="onRecordButtonMouseOver(event)"
mouseOut="onRecordButtonMouseOut(event)" >

View File

@ -21,39 +21,18 @@
-->
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
title="{ResourceUtil.getInstance().getString('bbb.waitWindow.waitMessage.title')}" showCloseButton="false"
layout="vertical" width="350" horizontalAlign="center">
title="{ResourceUtil.getInstance().getString('bbb.waitWindow.waitMessage.title')}" showCloseButton="false"
layout="vertical" width="350" horizontalAlign="center">
<mx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.common.events.OpenWindowEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.main.model.ConferenceParameters;
public var conferenceParameters:ConferenceParameters;
private var urlLoader:URLLoader;
public function guestAllowed():void {
var dispatcher:Dispatcher = new Dispatcher();
var loadCommand:SuccessfulLoginEvent = new SuccessfulLoginEvent(SuccessfulLoginEvent.USER_LOGGED_IN);
loadCommand.conferenceParameters = conferenceParameters;
dispatcher.dispatchEvent(loadCommand);
public function removeWindow():void {
PopUpManager.removePopUp(this);
}
public function removeWindow():void {
PopUpManager.removePopUp(this);
}
}
]]>
</mx:Script>
<mx:Text text="{ResourceUtil.getInstance().getString('bbb.waitWindow.waitMessage.message')}" width="100%" textAlign="center" />

View File

@ -29,12 +29,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.LogoutEvent;
<!--TODO: Move guest events to user events? -->
import org.bigbluebutton.main.events.AddGuestEvent;
import org.bigbluebutton.main.events.RemoveGuestRequestEvent;
import org.bigbluebutton.main.events.ResponseModeratorEvent;
import org.bigbluebutton.main.events.SuccessfulLoginEvent;
import org.bigbluebutton.main.events.UserServicesEvent;
import org.bigbluebutton.main.events.WaitModeratorEvent;
import org.bigbluebutton.main.model.GuestManager;
import org.bigbluebutton.main.model.users.UserService;
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
@ -150,58 +147,30 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<!-- End Lock Events -->
<!-- Guest Events -->
<EventHandlers type="{SuccessfulLoginEvent.USER_LOGGED_IN}" >
<MethodInvoker generator="{UserService}" method="getAllGuests" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{AddGuestEvent.ADD_GUEST}" >
<EventHandlers type="{BBBEvent.ADD_GUEST_TO_LIST}" >
<MethodInvoker generator="{GuestManager}" method="addGuest" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{LogoutEvent.GUEST_KICKED_OUT}" >
<EventHandlers type="{BBBEvent.REMOVE_GUEST_FROM_LIST}" >
<MethodInvoker generator="{GuestManager}" method="removeGuest" arguments="{event.payload.userId}" />
</EventHandlers>
<EventHandlers type="{LogoutEvent.MODERATOR_DENIED_ME}" >
<MethodInvoker generator="{UserService}" method="guestDisconnect" />
<MethodInvoker generator="{UserService}" method="logoutUser" />
</EventHandlers>
<EventHandlers type="LOAD_MODULE_GUEST_AUTO_ACCEPT">
<MethodInvoker generator="{UserService}" method="loadModulesCommand"/>
</EventHandlers>
<EventHandlers type="{WaitModeratorEvent.USER_LOGGED_IN}" >
<MethodInvoker generator="{UserService}" method="askToEnter" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{ResponseModeratorEvent.RESPONSE}" >
<MethodInvoker generator="{UserService}" method="responseToGuest" arguments="{event}" />
<MethodInvoker generator="{GuestManager}" method="removeGuest" arguments="{event.userid}" />
</EventHandlers>
<EventHandlers type="{RemoveGuestRequestEvent.GUEST_EVENT}" >
<MethodInvoker generator="{GuestManager}" method="removeGuest" arguments="{event.userid}" />
<!-- MethodInvoker generator="{GuestManager}" method="removeGuest" arguments="{event.userid}" /-->
</EventHandlers>
<EventHandlers type="{ResponseModeratorEvent.RESPONSE_ALL}" >
<MethodInvoker generator="{UserService}" method="responseToAllGuests" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{BBBEvent.ASK_TO_ACCEPT_GUEST}" >
<MethodInvoker generator="{UserService}" method="askToAccept" />
</EventHandlers>
<EventHandlers type="{BBBEvent.ACCEPT_GUEST}" >
<MethodInvoker generator="{UserService}" method="acceptGuest" />
</EventHandlers>
<EventHandlers type="{BBBEvent.DENY_GUEST}" >
<MethodInvoker generator="{UserService}" method="denyGuest" />
<MethodInvoker generator="{UserService}" method="responseToGuest" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{BBBEvent.BROADCAST_GUEST_POLICY}" >
<MethodInvoker generator="{UserService}" method="newGuestPolicy" arguments="{event}" />
</EventHandlers>
<EventHandlers type="{BBBEvent.KICK_GUEST}" >
<MethodInvoker generator="{UserService}" method="kickGuest" arguments="{event}" />
<MethodInvoker generator="{UserService}" method="setGuestPolicy" arguments="{event}" />
</EventHandlers>
<!-- End Guest Events -->
</EventMap>

View File

@ -32,13 +32,10 @@ package org.bigbluebutton.modules.users.services
import org.bigbluebutton.core.services.UsersService;
import org.bigbluebutton.core.vo.LockSettings;
import org.bigbluebutton.core.vo.LockSettingsVO;
import org.bigbluebutton.main.events.AddGuestEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ModeratorRespEvent;
import org.bigbluebutton.main.events.PresenterStatusEvent;
import org.bigbluebutton.main.events.RemoveGuestRequestEvent;
import org.bigbluebutton.main.events.SwitchedPresenterEvent;
import org.bigbluebutton.main.events.UserJoinedEvent;
import org.bigbluebutton.main.events.UserLeftEvent;
@ -61,6 +58,7 @@ package org.bigbluebutton.modules.users.services
private var dispatcher:Dispatcher;
private var _conference:Conference;
public var onAllowedToJoin:Function = null;
private static var globalDispatcher:Dispatcher = new Dispatcher();
public function MessageReceiver() {
@ -136,23 +134,14 @@ package org.bigbluebutton.modules.users.services
case "permissionsSettingsChanged":
handlePermissionsSettingsChanged(message);
break;
case "user_requested_to_enter":
handleGuestRequestedToEnter(message);
break;
case "get_guest_policy_reply":
handleGetGuestPolicyReply(message);
break;
case "guest_policy_changed":
handleGuestPolicyChanged(message);
break;
case "get_guests_waiting_reply":
handleGetGuestsWaitingReply(message);
break;
case "response_to_guest":
handleResponseToGuest(message);
break;
case "guest_kicked":
handleGuestKicked(message);
case "guest_access_denied":
handleGuestAccessDenied(message);
break;
}
}
@ -381,10 +370,10 @@ package org.bigbluebutton.modules.users.services
UsersService.getInstance().userLeft(webUser);
if(webUser.guest) {
var e:RemoveGuestRequestEvent = new RemoveGuestRequestEvent(RemoveGuestRequestEvent.GUEST_EVENT);
e.userid = webUser.userId;
dispatcher.dispatchEvent(e);
if(webUser.waitingForAcceptance) {
var removeGuest:BBBEvent = new BBBEvent(BBBEvent.REMOVE_GUEST_FROM_LIST);
removeGuest.payload.userId = webUser.userId;
dispatcher.dispatchEvent(removeGuest);
}
var user:BBBUser = UserManager.getInstance().getConference().getUser(webUserId);
@ -516,7 +505,7 @@ package org.bigbluebutton.modules.users.services
private function handleUserUnsharedWebcam(msg: Object):void {
trace(LOG + "*** handleUserUnsharedWebcam " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
var map:Object = JSON.parse(msg.msg);
UserManager.getInstance().getConference().unsharedWebcam(map.userId, map.webcamStream);
}
@ -539,10 +528,11 @@ package org.bigbluebutton.modules.users.services
user.name = joinedUser.name;
user.role = joinedUser.role;
user.guest = joinedUser.guest;
user.acceptedJoin = !user.guest;
user.waitingForAcceptance = joinedUser.waitingForAcceptance;
user.externUserID = joinedUser.externUserID;
user.isLeavingFlag = false;
user.listenOnly = joinedUser.listenOnly;
user.me = (user.userID == UserManager.getInstance().getConference().getMyUserId())
trace(LOG + "User status: hasStream " + joinedUser.hasStream);
@ -562,7 +552,36 @@ package org.bigbluebutton.modules.users.services
var joinEvent:UserJoinedEvent = new UserJoinedEvent(UserJoinedEvent.JOINED);
joinEvent.userID = user.userID;
dispatcher.dispatchEvent(joinEvent);
if (user.guest) {
if (user.waitingForAcceptance) {
if (user.me) {
var waitCommand:BBBEvent = new BBBEvent(BBBEvent.WAITING_FOR_MODERATOR_ACCEPTANCE);
dispatcher.dispatchEvent(waitCommand);
} else {
var e:BBBEvent = new BBBEvent(BBBEvent.ADD_GUEST_TO_LIST);
e.payload.userId = user.userID;
e.payload.name = user.name;
dispatcher.dispatchEvent(e);
}
} else {
if (user.me) {
var allowedCommand:BBBEvent = new BBBEvent(BBBEvent.MODERATOR_ALLOWED_ME_TO_JOIN);
dispatcher.dispatchEvent(allowedCommand);
} else {
var removeGuest:BBBEvent = new BBBEvent(BBBEvent.REMOVE_GUEST_FROM_LIST);
removeGuest.payload.userId = user.userID;
dispatcher.dispatchEvent(removeGuest);
}
}
}
if (user.me && (!user.guest || !user.waitingForAcceptance)) {
if (onAllowedToJoin != null) {
onAllowedToJoin();
onAllowedToJoin = null;
}
}
}
/**
@ -579,7 +598,7 @@ package org.bigbluebutton.modules.users.services
if(map.status == "mood") {
dispatcher.dispatchEvent(new ChangeStatusBtnEvent(map.userID, statusArray[0]));
}
if (msg.status == "presenter"){
var e:PresenterStatusEvent = new PresenterStatusEvent(PresenterStatusEvent.PRESENTER_NAME_CHANGE);
e.userID = map.userID;
@ -599,18 +618,6 @@ package org.bigbluebutton.modules.users.services
}
}
public function handleGuestRequestedToEnter(msg:Object):void {
trace(LOG + "*** handleRequestedToEnter " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
if(UsersUtil.amIModerator() && UsersUtil.amIWaitForModerator() == false) {
var e:AddGuestEvent = new AddGuestEvent();
e.userid = map.userId;
e.name = map.name;
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(e);
}
}
public function handleGuestPolicyChanged(msg:Object):void {
trace(LOG + "*** handleGuestPolicyChanged " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
@ -626,69 +633,15 @@ package org.bigbluebutton.modules.users.services
var policy:BBBEvent = new BBBEvent(BBBEvent.RETRIEVE_GUEST_POLICY);
policy.payload['guestPolicy'] = map.guestPolicy;
if(UsersUtil.amIGuest()) {
if(map.guestPolicy == "ALWAYS_DENY")
dispatcher.dispatchEvent(new BBBEvent(BBBEvent.DENY_GUEST));
else if(map.guestPolicy == "ALWAYS_ACCEPT")
dispatcher.dispatchEvent(new BBBEvent(BBBEvent.ACCEPT_GUEST));
else
dispatcher.dispatchEvent(new BBBEvent(BBBEvent.ASK_TO_ACCEPT_GUEST));
}
dispatcher.dispatchEvent(policy);
}
public function handleResponseToGuest(msg:Object):void {
trace(LOG + "*** handleResponseToGuest " + msg.msg + " **** \n");
public function handleGuestAccessDenied(msg:Object):void {
trace(LOG + "*** handleGuestAccessDenied " + msg.msg + " ****");
var map:Object = JSON.parse(msg.msg);
var dispatcher:Dispatcher = new Dispatcher();
if(UsersUtil.getMyUserID() == map.userId && UsersUtil.amIWaitForModerator()) {
UsersUtil.setWaitForModerator(false);
if(map.response == false) {
var kickEvent:BBBEvent = new BBBEvent(BBBEvent.KICK_GUEST);
kickEvent.payload.userId = map.userId;
dispatcher.dispatchEvent(kickEvent);
}
else {
var allowCommand:ModeratorRespEvent = new ModeratorRespEvent(ModeratorRespEvent.GUEST_ALLOWED);
dispatcher.dispatchEvent(allowCommand);
}
}
if(UsersUtil.amIModerator()) {
var e:RemoveGuestRequestEvent = new RemoveGuestRequestEvent(RemoveGuestRequestEvent.GUEST_EVENT);
e.userid = map.userId;
dispatcher.dispatchEvent(e);
}
}
public function handleGetGuestsWaitingReply(msg:Object):void {
trace(LOG + "*** handleGetGuestsPolicyReply " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
if(UsersUtil.amIModerator()) {
var guests:Array = map.guestsWaiting.split(",");
for each(var guest:String in guests) {
if(guest != "") {
var pairSplited:Array = guest.split(":");
var addGuestEvent:AddGuestEvent = new AddGuestEvent(AddGuestEvent.ADD_GUEST);
addGuestEvent.userid = pairSplited[0];
addGuestEvent.name = pairSplited[1];
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(addGuestEvent);
}
}
}
}
public function handleGuestKicked(msg:Object):void {
trace(LOG + "*** handleGuestKicked " + msg.msg + " **** \n");
var map:Object = JSON.parse(msg.msg);
if (UsersUtil.getMyUserID() == map.guestId){
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.GUEST_KICKED_OUT));
if (UsersUtil.getMyUserID() == map.userId) {
dispatcher.dispatchEvent(new LogoutEvent(LogoutEvent.MODERATOR_DENIED_ME));
}
}
}

View File

@ -395,58 +395,11 @@ package org.bigbluebutton.modules.users.services
);
}
public function queryForGuestsWaiting():void {
trace(LOG + "queryForGuestsWaiting");
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"participants.getGuestsWaiting",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
function(status:String):void { // status - On error occurred
LogUtil.error(status);
}
);
}
public function kickGuest(userId:String):void {
trace(LOG + "kickGuest userID:[" + userId + "]");
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"participants.kickGuest",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
function(status:String):void { // status - On error occurred
LogUtil.error(status);
},
userId
);
}
public function guestDisconnect():void {
//TODO: Still need this?
}
public function askToEnter():void {
trace(LOG + "askToEnter - userID:[" + UsersUtil.getMyUserID() + "]");
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"participants.askingToEnter",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
function(status:String):void { // status - On error occurred
LogUtil.error(status);
}
);
}
public function responseToGuest(userId:String, response:Boolean):void {
trace(LOG + "responseToGuest - guestID:[" + userId + "] response:[" + response + "]");
trace(LOG + "responseToGuest - userId:[" + userId + "] response:[" + response + "]");
var message:Object = new Object();
message["guestID"] = userId;
message["userId"] = userId;
message["response"] = response;
var _nc:ConnectionManager = BBB.initConnectionManager();
@ -463,18 +416,7 @@ package org.bigbluebutton.modules.users.services
}
public function responseToAllGuests(response:Boolean):void {
trace(LOG + "responseToAllGuests - response:[" + response + "]");
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage(
"participants.responseToAllGuests",
function(result:String):void { // On successful result
LogUtil.debug(result);
},
function(status:String):void { // status - On error occurred
LogUtil.error(status);
},
response
);
responseToGuest(null, response);
}
}
}
}

View File

@ -1853,6 +1853,8 @@ class ApiController {
userID("${att.externalUserId}")
fullName("${att.fullname}")
role("${att.role}")
guest("${att.guest}")
waitingForAcceptance("${att.waitingForAcceptance}")
isPresenter("${att.isPresenter()}")
isListeningOnly("${att.isListeningOnly()}")
hasJoinedVoice("${att.isVoiceJoined()}")

View File

@ -589,7 +589,7 @@ public class MeetingService implements MessageListener {
log.debug("User joined in meeting[{}]", message.meetingId);
Meeting m = getMeeting(message.meetingId);
if (m != null) {
User user = new User(message.userId, message.externalUserId, message.name, message.role, message.guest);
User user = new User(message.userId, message.externalUserId, message.name, message.role, message.guest, message.waitingForAcceptance);
m.userJoined(user);
log.info("New user in meeting [" + message.meetingId + "] user [" + user.getFullname() + "]");
@ -601,8 +601,10 @@ public class MeetingService implements MessageListener {
logData.put("externalUserId", user.getExternalUserId());
logData.put("username", user.getFullname());
logData.put("role", user.getRole());
logData.put("event", "user_joined_meeting");
logData.put("description", "User had joined the meeting.");
logData.put("guest", user.isGuest());
logData.put("waitingForAcceptance", user.isWaitingForAcceptance());
logData.put("event", MessagingConstants.USER_JOINED_EVENT);
logData.put("description", "User has joined the meeting.");
Gson gson = new Gson();
String logStr = gson.toJson(logData);
@ -630,8 +632,10 @@ public class MeetingService implements MessageListener {
logData.put("externalUserId", user.getExternalUserId());
logData.put("username", user.getFullname());
logData.put("role", user.getRole());
logData.put("event", "user_joined_meeting");
logData.put("description", "User had joined the meeting.");
logData.put("guest", user.isGuest());
logData.put("waitingForAcceptance", user.isWaitingForAcceptance());
logData.put("event", MessagingConstants.USER_LEFT_EVENT);
logData.put("description", "User left the meeting.");
Gson gson = new Gson();
String logStr = gson.toJson(logData);

View File

@ -32,16 +32,18 @@ public class User {
private String role;
private Map<String,String> status;
private Boolean guest;
private Boolean waitingForAcceptance;
private Boolean listeningOnly = false;
private Boolean voiceJoined = false;
private List<String> streams;
public User(String internalUserId, String externalUserId, String fullname, String role, Boolean guest) {
public User(String internalUserId, String externalUserId, String fullname, String role, Boolean guest, Boolean waitingForAcceptance) {
this.internalUserId = internalUserId;
this.externalUserId = externalUserId;
this.fullname = fullname;
this.role = role;
this.guest = guest;
this.waitingForAcceptance = waitingForAcceptance;
this.status = new ConcurrentHashMap<String, String>();
this.streams = Collections.synchronizedList(new ArrayList<String>());
}
@ -68,6 +70,14 @@ public class User {
public Boolean isGuest() {
return this.guest;
}
public void setWaitingForAcceptance(Boolean waitingForAcceptance) {
this.waitingForAcceptance = waitingForAcceptance;
}
public Boolean isWaitingForAcceptance() {
return this.waitingForAcceptance;
}
public String getFullname() {
return fullname;

View File

@ -93,4 +93,5 @@ public class Constants {
public static final String CREATE_TIME = "create_time";
public static final String CREATE_DATE = "create_date";
public static final String GUEST = "guest";
public static final String WAITING_FOR_ACCEPTANCE = "waiting_for_acceptance";
}

View File

@ -106,9 +106,10 @@ public class MeetingMessageHandler implements MessageHandler {
String username = user.get("name").getAsString();
String role = user.get("role").getAsString();
Boolean guest = user.get("guest").getAsBoolean();
Boolean waitingForAcceptance = user.get("waiting_for_acceptance").getAsBoolean();
for (MessageListener listener : listeners) {
listener.handle(new UserJoined(meetingId, userid, externuserid, username, role, guest));
listener.handle(new UserJoined(meetingId, userid, externuserid, username, role, guest, waitingForAcceptance));
}
} else if(MessagingConstants.USER_STATUS_CHANGE_EVENT.equalsIgnoreCase(messageName)) {
System.out.println("Handling [" + messageName + "] message.");

View File

@ -7,13 +7,15 @@ public class UserJoined implements IMessage {
public final String name;
public final String role;
public final Boolean guest;
public final Boolean waitingForAcceptance;
public UserJoined(String meetingId, String userId, String externalUserId, String name, String role, Boolean guest) {
public UserJoined(String meetingId, String userId, String externalUserId, String name, String role, Boolean guest, Boolean waitingForAcceptance) {
this.meetingId = meetingId;
this.userId = userId;
this.externalUserId = externalUserId;
this.name = name;
this.role = role;
this.guest = guest;
this.waitingForAcceptance = waitingForAcceptance;
}
}