BreakoutRoomStarted event finally arrives to the client.

This commit is contained in:
Ghazi Triki 2015-11-20 19:06:11 -02:00
parent 924a8cbefd
commit 6e9b95e347
9 changed files with 21 additions and 29 deletions

View File

@ -16,7 +16,6 @@ import org.bigbluebutton.common.messages.UserConnectedToGlobalAudio;
import org.bigbluebutton.common.messages.UserDisconnectedFromGlobalAudio;
import org.bigbluebutton.common.messages.ValidateAuthTokenMessage;
import org.bigbluebutton.core.api.IBigBlueButtonInGW;
import org.bigbluebutton.messages.BreakoutRoomStarted;
import org.bigbluebutton.messages.CreateMeetingRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -23,7 +23,6 @@ import org.bigbluebutton.messages._
import org.bigbluebutton.messages.payload._
import akka.event.Logging
import spray.json.JsonParser
import org.bigbluebutton.messages.BreakoutRoomStarted
class BigBlueButtonInGW(
val system: ActorSystem,

View File

@ -61,7 +61,7 @@ class JsonMessageSenderActor(val service: MessageSender)
// Breakout
private def handleBreakoutRoomStarted(msg: BreakoutRoomStartedOutMessage) {
val payload = new BreakoutRoomPayload(msg.breakout.breakoutId, msg.breakout.name)
val payload = new BreakoutRoomPayload(msg.meetingId, msg.breakout.breakoutId, msg.breakout.name)
val request = new BreakoutRoomStarted(payload)
service.send(MessagingConstants.FROM_MEETING_CHANNEL, request.toJson)
}

View File

@ -162,7 +162,4 @@ object MessageNames {
val KEEP_ALIVE_REPLY = "keep_alive_reply"
val USER_LISTEN_ONLY = "user_listening_only"
val GET_ALL_MEETINGS_REPLY = "get_all_meetings_reply"
// breakout rooms
val BREAKOUT_ROOM_STARTED = "BreakoutRoomStarted"
}

View File

@ -30,7 +30,6 @@ trait BreakoutRoomApp extends SystemConfiguration {
}
def handleCreateBreakoutRooms(msg: CreateBreakoutRooms) {
log.debug("## handleCreateBreakoutRooms{}", msg)
var i = 0
for (room <- msg.rooms) {
i += 1
@ -38,7 +37,6 @@ trait BreakoutRoomApp extends SystemConfiguration {
val breakoutMeetingId = BreakoutRoomsUtil.createMeetingId(mProps.meetingID, i)
val voiceConfId = BreakoutRoomsUtil.createVoiceConfId(mProps.voiceBridge, i)
val r = breakoutModel.createBreakoutRoom(breakoutMeetingId, room.name, voiceConfId, room.users, presURL)
log.debug("## Added breakout room {}", r)
val p = new BreakoutRoomOutPayload(r.id, r.name, mProps.meetingID,
r.voiceConfId, msg.durationInMinutes, bbbWebModeratorPassword, bbbWebViewerPassword,
r.defaultPresentationURL)
@ -62,11 +60,8 @@ trait BreakoutRoomApp extends SystemConfiguration {
}
def handleBreakoutRoomCreated(msg: BreakoutRoomCreated) {
log.debug("## Breakout room created {}!!!", msg)
val rooms = breakoutModel.getBreakoutRoom(msg.breakoutRoomId)
log.debug("## Looking in rooms {}", breakoutModel.getRooms());
log.debug("## Found rooms {} for breakoutRoomId", rooms)
rooms foreach { room =>
val room = breakoutModel.getBreakoutRoom(msg.breakoutRoomId)
room foreach { room =>
sendBreakoutRoomStarted(mProps.meetingID, room.name, room.id, room.voiceConfId)
}
@ -78,7 +73,6 @@ trait BreakoutRoomApp extends SystemConfiguration {
}
def sendBreakoutRoomStarted(meetingId: String, breakoutName: String, breakoutId: String, voiceConfId: String) {
log.debug("## Sending BreakoutRoomStartedOutMessage for {}", meetingId)
outGW.send(new BreakoutRoomStartedOutMessage(meetingId, mProps.recorded, new BreakoutRoomBody(breakoutName, breakoutId)))
}

View File

@ -4,6 +4,7 @@ import org.bigbluebutton.core.messaging.Util
import org.bigbluebutton.core.api._
import com.google.gson.Gson
import scala.collection.JavaConverters._
import org.bigbluebutton.messages._
object MeetingMessageToJsonConverter {
def meetingDestroyedToJson(msg: MeetingDestroyed): String = {
@ -132,10 +133,11 @@ object MeetingMessageToJsonConverter {
def breakoutRoomStartedOutMessageToJson(msg: BreakoutRoomStartedOutMessage): String = {
val payload = new java.util.HashMap[String, Any]()
payload.put(Constants.MEETING_ID, msg.meetingId)
payload.put("breakout", msg.breakout)
payload.put("meetingId", msg.meetingId)
payload.put("breakoutId", msg.breakout.breakoutId)
payload.put("name", msg.breakout.name)
val header = Util.buildHeader(MessageNames.BREAKOUT_ROOM_STARTED, None)
val header = Util.buildHeader(BreakoutRoomStarted.NAME, None)
Util.buildJson(header, payload)
}
}

View File

@ -2,11 +2,13 @@ package org.bigbluebutton.messages.payload;
public class BreakoutRoomPayload {
public final String breakoutId;
public final String name;
public BreakoutRoomPayload(String breakoutId, String name) {
this.breakoutId = breakoutId;
this.name = name;
}
public final String meetingId;
public final String breakoutId;
public final String name;
public BreakoutRoomPayload(String meetingId, String breakoutId, String name) {
this.meetingId = meetingId;
this.breakoutId = breakoutId;
this.name = name;
}
}

View File

@ -52,7 +52,7 @@ public class UserClientMessageSender {
public void handleUsersMessage(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
@ -196,7 +196,7 @@ public class UserClientMessageSender {
if (brsm != null) {
processBreakoutRoomStarted(brsm);
}
break;
break;
}
}
}
@ -535,14 +535,14 @@ public class UserClientMessageSender {
private void processBreakoutRoomStarted(BreakoutRoomStarted msg) {
Map<String, Object> args = new HashMap<String, Object>();
args.put("breakoutId", msg.payload.breakoutId);
args.put("meetingId", msg.payload.meetingId);
args.put("name", msg.payload.name);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(args));
// FIXME : we need the meetingId in addition of breakoutId
BroadcastClientMessage m = new BroadcastClientMessage(msg.payload.breakoutId, "updateBreakoutUsers", message);
BroadcastClientMessage m = new BroadcastClientMessage(msg.payload.meetingId, "breakoutRoomStarted", message);
service.sendMessage(m);
}
}

View File

@ -62,7 +62,6 @@ import org.bigbluebutton.api.messaging.messages.UserListeningOnly;
import org.bigbluebutton.api.messaging.messages.UserSharedWebcam;
import org.bigbluebutton.api.messaging.messages.UserStatusChanged;
import org.bigbluebutton.api.messaging.messages.UserUnsharedWebcam;
import org.bigbluebutton.messages.BreakoutRoomStarted;
import org.bigbluebutton.messages.payload.BreakoutRoomPayload;
import org.bigbluebutton.presentation.PresentationUrlDownloadService;
import org.bigbluebutton.web.services.ExpiredMeetingCleanupTimerTask;