Search in sources :

Example 1 with SendCaptionHistoryReplyMessage

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