Merge branch 'tolwi-fix_inline_response' into dev

This commit is contained in:
Rubenlagus 2016-04-20 19:45:56 +02:00
commit 2a5bd25532
12 changed files with 24 additions and 35 deletions

View File

@ -6,7 +6,7 @@
<packaging>jar</packaging>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>2.1</version>
<version>2.1.1-SNAPSHOT</version>
<name>Telegram Bots</name>
<description>Easy to use library to create Telegram Bots</description>

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -154,9 +153,9 @@ public class InlineQueryResultArticle implements InlineQueryResult {
jsonObject.put(TYPE_FIELD, this.type);
jsonObject.put(ID_FIELD, this.id);
jsonObject.put(TITLE_FIELD, this.title);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (url != null) {
jsonObject.put(URL_FIELD, this.url);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -132,10 +131,10 @@ public class InlineQueryResultAudio implements InlineQueryResult {
jsonObject.put(AUDIO_DURATION_FIELD, audioDuration);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -150,10 +149,10 @@ public class InlineQueryResultContact implements InlineQueryResult {
jsonObject.put(LAST_NAME_FIELD, lastName);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
if (thumbUrl != null) {
jsonObject.put(THUMBURL_FIELD, this.thumbUrl);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -179,10 +178,10 @@ public class InlineQueryResultDocument implements InlineQueryResult {
jsonObject.put(CAPTION_FIELD, caption);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
if (thumbUrl != null) {
jsonObject.put(THUMBURL_FIELD, this.thumbUrl);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -159,10 +158,10 @@ public class InlineQueryResultGif implements InlineQueryResult {
jsonObject.put(CAPTION_FIELD, this.caption);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;
}

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -148,10 +147,10 @@ public class InlineQueryResultLocation implements InlineQueryResult {
jsonObject.put(TITLE_FIELD, title);
jsonObject.put(LONGITUDE_FIELD, longitude);
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
if (thumbUrl != null) {
jsonObject.put(THUMBURL_FIELD, this.thumbUrl);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -141,7 +140,7 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
public JSONObject toJson() {
JSONObject jsonObject = new JSONObject();
jsonObject.put(TYPE_FIELD, this.type);
jsonObject.put(TYPE_FIELD, type);
jsonObject.put(ID_FIELD, this.id);
jsonObject.put(MPEG4URL_FIELD, this.mpeg4Url);
if (mpeg4Width != null) {
@ -160,10 +159,10 @@ public class InlineQueryResultMpeg4Gif implements InlineQueryResult {
jsonObject.put(CAPTION_FIELD, this.caption);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -190,10 +189,10 @@ public class InlineQueryResultPhoto implements InlineQueryResult {
jsonObject.put(CAPTION_FIELD, this.caption);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -175,10 +174,10 @@ public class InlineQueryResultVenue implements InlineQueryResult {
jsonObject.put(FOURSQUARE_ID_FIELD, foursquareId);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
if (thumbUrl != null) {
jsonObject.put(THUMBURL_FIELD, this.thumbUrl);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -205,10 +204,10 @@ public class InlineQueryResultVideo implements InlineQueryResult {
jsonObject.put(CAPTION_FIELD, caption);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import org.json.JSONObject;
import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.api.objects.replykeyboard.InlineKeyboardMarkup;
@ -116,10 +115,10 @@ public class InlineQueryResultVoice implements InlineQueryResult {
jsonObject.put(VOICE_DURATION_FIELD, voiceDuration);
}
if (replyMarkup != null) {
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup);
jsonObject.put(REPLY_MARKUP_FIELD, replyMarkup.toJson());
}
if (inputMessageContent != null) {
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent);
jsonObject.put(INPUTMESSAGECONTENT_FIELD, inputMessageContent.toJson());
}
return jsonObject;
}