use of org.bigbluebutton.common.messages.EditCaptionHistoryMessage in project bigbluebutton by bigbluebutton.
the class CaptionClientMessageSender method handleCaptionMessage.
public void handleCaptionMessage(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");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
switch(messageName) {
case SendCaptionHistoryReplyMessage.SEND_CAPTION_HISTORY_REPLY:
SendCaptionHistoryReplyMessage sch = SendCaptionHistoryReplyMessage.fromJson(message);
if (sch != null) {
processSendCaptionHistoryReplyMessage(sch);
}
break;
case UpdateCaptionOwnerMessage.UPDATE_CAPTION_OWNER:
UpdateCaptionOwnerMessage uco = UpdateCaptionOwnerMessage.fromJson(message);
if (uco != null) {
processUpdateCaptionOwnerMessage(uco);
}
break;
case EditCaptionHistoryMessage.EDIT_CAPTION_HISTORY:
EditCaptionHistoryMessage ech = EditCaptionHistoryMessage.fromJson(message);
if (ech != null) {
processEditCaptionHistoryMessage(ech);
}
break;
}
}
}
}
use of org.bigbluebutton.common.messages.EditCaptionHistoryMessage in project bigbluebutton by bigbluebutton.
the class CaptionMessageReceiver method handleMessage.
@Override
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(MessagingConstants.TO_CAPTION_CHANNEL)) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (SendCaptionHistoryRequestMessage.SEND_CAPTION_HISTORY_REQUEST.equals(messageName)) {
SendCaptionHistoryRequestMessage msg = SendCaptionHistoryRequestMessage.fromJson(message);
bbbGW.sendCaptionHistory(msg.meetingID, msg.requesterID);
} else if (UpdateCaptionOwnerMessage.UPDATE_CAPTION_OWNER.equals(messageName)) {
UpdateCaptionOwnerMessage msg = UpdateCaptionOwnerMessage.fromJson(message);
bbbGW.updateCaptionOwner(msg.meetingID, msg.locale, msg.localeCode, msg.ownerID);
} else if (EditCaptionHistoryMessage.EDIT_CAPTION_HISTORY.equals(messageName)) {
EditCaptionHistoryMessage msg = EditCaptionHistoryMessage.fromJson(message);
bbbGW.editCaptionHistory(msg.meetingID, msg.userID, msg.startIndex, msg.endIndex, msg.locale, msg.localeCode, msg.text);
}
}
}
}
}
Aggregations