- convert get users query to 2x

This commit is contained in:
Richard Alam 2017-07-16 14:06:05 -07:00
parent bf1031374a
commit 43edb0ea4c
6 changed files with 31 additions and 19 deletions

View File

@ -0,0 +1,18 @@
package org.bigbluebutton.core.apps.users
import org.bigbluebutton.common2.msgs.GetUsersMeetingReqMsg
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.running.{ HandlerHelpers, LiveMeeting }
trait GetUsersMeetingReqMsgHdlr extends HandlerHelpers {
this: UsersApp =>
val liveMeeting: LiveMeeting
val outGW: OutMessageGateway
def handleGetUsersMeetingReqMsg(msg: GetUsersMeetingReqMsg): Unit = {
sendAllUsersInMeeting(outGW, msg.body.userId, liveMeeting)
sendAllVoiceUsersInMeeting(outGW, msg.body.userId, liveMeeting.voiceUsers, liveMeeting.props.meetingProp.intId)
sendAllWebcamStreams(outGW, msg.body.userId, liveMeeting.webcams, liveMeeting.props.meetingProp.intId)
}
}

View File

@ -11,7 +11,8 @@ class UsersApp(
val outGW: OutMessageGateway
)(implicit val context: ActorContext)
extends ValidateAuthTokenReqMsgHdlr {
extends ValidateAuthTokenReqMsgHdlr
with GetUsersMeetingReqMsgHdlr {
val log = Logging(context.system, getClass)
}

View File

@ -71,6 +71,9 @@ class ReceivedJsonMsgHandlerActor(
case DestroyMeetingSysCmdMsg.NAME =>
route[DestroyMeetingSysCmdMsg](meetingManagerChannel, envelope, jsonNode)
// Users
case GetUsersMeetingReqMsg.NAME =>
routeGenericMsg[GetUsersMeetingReqMsg](envelope, jsonNode)
// Poll
case StartCustomPollReqMsg.NAME =>
routeGenericMsg[StartCustomPollReqMsg](envelope, jsonNode)

View File

@ -171,6 +171,7 @@ class MeetingActor(
case m: GetRecordingStatusReqMsg => handleGetRecordingStatusReqMsg(m)
case m: ChangeUserEmojiCmdMsg => handleChangeUserEmojiCmdMsg(m)
case m: EjectUserFromMeetingCmdMsg => handleEjectUserFromMeetingCmdMsg(m)
case m: GetUsersMeetingReqMsg => usersApp.handleGetUsersMeetingReqMsg(m)
// Whiteboard
case m: SendCursorPositionPubMsg => handleSendCursorPositionPubMsg(m)

View File

@ -1,16 +0,0 @@
package org.bigbluebutton.core2.message.handlers.users
import org.bigbluebutton.core.OutMessageGateway
import org.bigbluebutton.core.api.GetUsers
import org.bigbluebutton.core.running.{ HandlerHelpers, MeetingActor }
trait GetUsersHdlr extends HandlerHelpers {
this: MeetingActor =>
val outGW: OutMessageGateway
def handleGetUsers(msg: GetUsers): Unit = {
sendAllUsersInMeeting(outGW, msg.requesterID, liveMeeting)
}
}

View File

@ -42,8 +42,13 @@ package org.bigbluebutton.modules.users.services
private static const LOGGER:ILogger = getClassLogger(MessageSender);
public function queryForParticipants():void {
var message:Object = {
header: {name: "GetUsersMeetingReqMsg", meetingId: UsersUtil.getInternalMeetingID(), userId: UsersUtil.getMyUserID()},
body: {userId: UsersUtil.getMyUserID()}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("participants.getParticipants",
_nc.sendMessage2x(
function(result:String):void { // On successful result
},
function(status:String):void { // status - On error occurred
@ -51,7 +56,7 @@ package org.bigbluebutton.modules.users.services
logData.tags = ["apps"];
logData.message = "Error occured querying users.";
LOGGER.info(JSON.stringify(logData));
}
}, JSON.stringify(message)
);
}