diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-10-18 22:04:53 +0200 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-10-18 22:04:53 +0200 |
commit | a3f5a5e56c998cdee8a4f273f3c3cdafadc9d35b (patch) | |
tree | 676ccf2daf6bda2e46e7d4dce4ae6ec2ef65741b | |
parent | a547fca53b0cad280a4ef3a42b65490efc8e631d (diff) |
Fix parse error
-rw-r--r-- | src/TgTypeParser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp index f6ae9f0..1f49489 100644 --- a/src/TgTypeParser.cpp +++ b/src/TgTypeParser.cpp @@ -739,8 +739,9 @@ PollAnswer::Ptr TgTypeParser::parseJsonAndGetPollAnswer(const boost::property_tr auto result(std::make_shared<PollAnswer>()); result->pollId = data.get<std::string>("poll_id", ""); result->user = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "user"); - result->optionIds = parseJsonAndGetArray<std::int32_t>([] (const boost::property_tree::ptree& innerData)->std::int32_t { - return innerData.get<std::int32_t>(0); + result->optionIds = parseJsonAndGetArray<std::int32_t>( + [] (const boost::property_tree::ptree& innerData)->std::int32_t { + return innerData.get<std::int32_t>(""); }, data, "option_ids"); return result; } @@ -3271,8 +3272,9 @@ InputInvoiceMessageContent::Ptr TgTypeParser::parseJsonAndGetInputInvoiceMessage result->currency = data.get<std::string>("currency", ""); result->prices = parseJsonAndGetArray<LabeledPrice>(&TgTypeParser::parseJsonAndGetLabeledPrice, data, "prices"); result->maxTipAmount = data.get<std::int32_t>("max_tip_amount", 0); - result->suggestedTipAmounts = parseJsonAndGetArray<std::int32_t>([] (const boost::property_tree::ptree& innerData)->std::int32_t { - return innerData.get<std::int32_t>(0); + result->suggestedTipAmounts = parseJsonAndGetArray<std::int32_t>( + [] (const boost::property_tree::ptree& innerData)->std::int32_t { + return innerData.get<std::int32_t>(""); }, data, "suggested_tip_amounts"); result->providerData = data.get<std::string>("provider_data", ""); result->photoUrl = data.get<std::string>("photo_url", ""); |