Browse Source

1. Some api updates

master
Rubenlagu 11 years ago
committed by Rubenlagus
parent
commit
416ff1816f
  1. 14
      src/main/java/org/telegram/api/Message.java

14
src/main/java/org/telegram/api/Message.java

@ -81,6 +81,9 @@ public class Message {
public static final String REPLYTOMESSAGE_FIELD = "reply_to_message"; public static final String REPLYTOMESSAGE_FIELD = "reply_to_message";
@JsonProperty(REPLYTOMESSAGE_FIELD) @JsonProperty(REPLYTOMESSAGE_FIELD)
private Message replyToMessage; private Message replyToMessage;
public static final String VOICE_FIELD = "voice";
@JsonProperty(VOICE_FIELD)
private Voice voice; ///< Optional. Message is a voice message, information about the file
public Message() { public Message() {
super(); super();
@ -126,6 +129,9 @@ public class Message {
if (jsonObject.has(LOCATION_FIELD)) { if (jsonObject.has(LOCATION_FIELD)) {
this.location = new Location(jsonObject.getJSONObject(LOCATION_FIELD)); this.location = new Location(jsonObject.getJSONObject(LOCATION_FIELD));
} }
if (jsonObject.has(VOICE_FIELD)) {
this.voice = new Voice(jsonObject.getJSONObject(VOICE_FIELD));
}
if (jsonObject.has(NEWCHATPARTICIPANT_FIELD)) { if (jsonObject.has(NEWCHATPARTICIPANT_FIELD)) {
this.newChatParticipant = new User(jsonObject.getJSONObject(NEWCHATPARTICIPANT_FIELD)); this.newChatParticipant = new User(jsonObject.getJSONObject(NEWCHATPARTICIPANT_FIELD));
} }
@ -342,4 +348,12 @@ public class Message {
public boolean hasLocation() { public boolean hasLocation() {
return location != null; return location != null;
} }
public Voice getVoice() {
return voice;
}
public void setVoice(Voice voice) {
this.voice = voice;
}
} }

Loading…
Cancel
Save