summaryrefslogtreecommitdiff
path: root/src/TgTypeParser.cpp
diff options
context:
space:
mode:
authorAndrea Giove <andreagiove@outlook.com>2016-03-29 15:23:15 +0200
committerAndrea Giove <andreagiove@outlook.com>2016-03-29 15:23:15 +0200
commitc5a4f537b4a11455d1924ae737a92a8f16b2fcd7 (patch)
tree4aad2ee1cf8d397407ee1f901eba45da1eb5ea61 /src/TgTypeParser.cpp
parent37e31a89337afd947e41794eeaf78c9d1d2d0b73 (diff)
Fix problem with Update parsing
Diffstat (limited to 'src/TgTypeParser.cpp')
-rw-r--r--src/TgTypeParser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp
index 079e073..244496e 100644
--- a/src/TgTypeParser.cpp
+++ b/src/TgTypeParser.cpp
@@ -347,9 +347,9 @@ string TgTypeParser::parseLocation(const Location::Ptr& object) const {
Update::Ptr TgTypeParser::parseJsonAndGetUpdate(const ptree& data) const {
Update::Ptr result(new Update);
result->updateId = data.get<int32_t>("update_id");
- result->message = parseJsonAndGetMessage(data.find("message")->second);
- result->inlineQuery = parseJsonAndGetInlineQuery(data.find("inline_query")->second);
- result->chosenInlineResult = parseJsonAndGetChosenInlineResult(data.find("chosen_inline_result")->second);
+ result->message = tryParseJson<Message>(&TgTypeParser::parseJsonAndGetMessage, data, "message");
+ result->inlineQuery = tryParseJson<InlineQuery>(&TgTypeParser::parseJsonAndGetInlineQuery, data, "inline_query");
+ result->chosenInlineResult = tryParseJson<ChosenInlineResult>(&TgTypeParser::parseJsonAndGetChosenInlineResult, data, "chosen_inline_result");
return result;
}