Skip to content

Commit

Permalink
Merge pull request #42 from rubenlagus/dev
Browse files Browse the repository at this point in the history
Fix CallbackQuery bug
  • Loading branch information
rubenlagus committed Apr 21, 2016
2 parents f2e5698 + a601e98 commit 98acc55
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ public CallbackQuery() {
super();
}

public CallbackQuery(JSONObject jsonObject) {
super();
this.id = jsonObject.getString(ID_FIELD);
this.from = new User(jsonObject.getJSONObject(FROM_FIELD));
if (jsonObject.has(MESSAGE_FIELD)) {
this.message = new Message(jsonObject.getJSONObject(MESSAGE_FIELD));
}
if (jsonObject.has(INLINE_MESSAGE_ID_FIELD)) {
this.inlineMessageId = jsonObject.getString(INLINE_MESSAGE_ID_FIELD);
}
data = jsonObject.getString(DATA_FIELD);
}

public String getId() {
return this.id;
}
Expand All @@ -60,24 +73,15 @@ public User getFrom() {
}

public Message getMessage() {
return this.getMessage();
return this.message;
}

public String getInlineMessageId() {
return this.inlineMessageId;
}

public CallbackQuery(JSONObject jsonObject) {
super();
this.id = jsonObject.getString(ID_FIELD);
this.from = new User(jsonObject.getJSONObject(FROM_FIELD));
if (jsonObject.has(MESSAGE_FIELD)) {
this.message = new Message(jsonObject.getJSONObject(MESSAGE_FIELD));
}
if (jsonObject.has(INLINE_MESSAGE_ID_FIELD)) {
this.inlineMessageId = jsonObject.getString(INLINE_MESSAGE_ID_FIELD);
}
data = jsonObject.getString(DATA_FIELD);
public String getData() {
return data;
}

@Override
Expand Down

0 comments on commit 98acc55

Please sign in to comment.