Search in sources :

Example 1 with SendCaptionHistoryRequestMessage

use of org.bigbluebutton.common.messages.SendCaptionHistoryRequestMessage 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);
                }
            }
        }
    }
}
Also used : SendCaptionHistoryRequestMessage(org.bigbluebutton.common.messages.SendCaptionHistoryRequestMessage) UpdateCaptionOwnerMessage(org.bigbluebutton.common.messages.UpdateCaptionOwnerMessage) JsonObject(com.google.gson.JsonObject) EditCaptionHistoryMessage(org.bigbluebutton.common.messages.EditCaptionHistoryMessage) JsonParser(com.google.gson.JsonParser)

Aggregations

JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 EditCaptionHistoryMessage (org.bigbluebutton.common.messages.EditCaptionHistoryMessage)1 SendCaptionHistoryRequestMessage (org.bigbluebutton.common.messages.SendCaptionHistoryRequestMessage)1 UpdateCaptionOwnerMessage (org.bigbluebutton.common.messages.UpdateCaptionOwnerMessage)1