Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first try and adding caption ownership
- Loading branch information
Showing
31 changed files
with
510 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...on-message/src/main/java/org/bigbluebutton/common/messages/UpdateCaptionOwnerMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.bigbluebutton.common.messages; | ||
|
||
import java.util.HashMap; | ||
import com.google.gson.JsonObject; | ||
import com.google.gson.JsonParser; | ||
|
||
|
||
public class UpdateCaptionOwnerMessage implements ISubscribedMessage { | ||
public static final String UPDATE_CAPTION_OWNER = "update_caption_owner_message"; | ||
public static final String VERSION = "0.0.1"; | ||
|
||
public final String meetingID; | ||
public final String locale; | ||
public final String ownerID; | ||
|
||
public UpdateCaptionOwnerMessage(String meetingID, String locale, String ownerID) { | ||
this.meetingID = meetingID; | ||
this.locale = locale; | ||
this.ownerID = ownerID; | ||
} | ||
|
||
public String toJson() { | ||
HashMap<String, Object> payload = new HashMap<String, Object>(); | ||
payload.put(Constants.MEETING_ID, meetingID); | ||
payload.put(Constants.LOCALE, locale); | ||
payload.put(Constants.OWNER_ID, ownerID); | ||
|
||
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(UPDATE_CAPTION_OWNER, VERSION, null); | ||
|
||
return MessageBuilder.buildJson(header, payload); | ||
} | ||
|
||
public static UpdateCaptionOwnerMessage fromJson(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"); | ||
JsonObject payload = (JsonObject) obj.get("payload"); | ||
|
||
if (header.has("name")) { | ||
String messageName = header.get("name").getAsString(); | ||
if (UPDATE_CAPTION_OWNER.equals(messageName)) { | ||
if (payload.has(Constants.MEETING_ID) | ||
&& payload.has(Constants.LOCALE) | ||
&& payload.has(Constants.OWNER_ID)) { | ||
String meetingID = payload.get(Constants.MEETING_ID).getAsString(); | ||
String locale = payload.get(Constants.LOCALE).getAsString(); | ||
String ownerID = payload.get(Constants.OWNER_ID).getAsString(); | ||
|
||
return new UpdateCaptionOwnerMessage(meetingID, locale, ownerID); | ||
} | ||
} | ||
} | ||
} | ||
return null; | ||
|
||
} | ||
} |
Oops, something went wrong.