summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Giove <andreagiove@outlook.com>2016-03-27 18:24:03 +0200
committerAndrea Giove <andreagiove@outlook.com>2016-03-27 18:24:03 +0200
commit405d973af3460ee2860d01c7169cf6749fa98b07 (patch)
tree33f5227ecf142138709378d3ef95e0cfee29519c /src
parentd2baea74a0ac09db992ab36a861d09caccdab697 (diff)
Fixed compilation errors
Diffstat (limited to 'src')
-rw-r--r--src/Api.cpp7
-rw-r--r--src/TgTypeParser.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Api.cpp b/src/Api.cpp
index 47c7882..325978f 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -255,11 +255,12 @@ void Api::setWebhook(const string& url) const {
sendRequest("setWebhook", args);
}
-void Api::answerInlineQuery(const std::string inlineQueryId, const std::vector<InlineQueryResult::Ptr> results,
- int32_t cacheTime=300, bool isPersonal=false, const std::string& nextOffset=""){
+void Api::answerInlineQuery(const std::string& inlineQueryId, const std::vector<InlineQueryResult::Ptr>& results,
+ int32_t cacheTime, bool isPersonal, const std::string& nextOffset){
vector<HttpReqArg> args;
args.push_back(HttpReqArg("inline_query_id", inlineQueryId));
- args.push_back(HttpReqArg("results", results, TgTypeParser::getInstance().parseInlineQueryResult));
+ string resultsJson = TgTypeParser::getInstance().parseArray<InlineQueryResult>(&TgTypeParser::parseInlineQueryResult, results);
+ args.push_back(HttpReqArg("results", resultsJson));
args.push_back(HttpReqArg("cache_time", cacheTime));
args.push_back(HttpReqArg("is_personal", isPersonal));
args.push_back(HttpReqArg("next_offset", nextOffset));
diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp
index eb7f769..079e073 100644
--- a/src/TgTypeParser.cpp
+++ b/src/TgTypeParser.cpp
@@ -362,7 +362,7 @@ string TgTypeParser::parseUpdate(const Update::Ptr& object) const {
appendToJson(result, "update_id", object->updateId);
appendToJson(result, "message", parseMessage(object->message));
appendToJson(result, "inline_query", parseInlineQuery(object->inlineQuery));
- appendToJson(result, "chosen_inline_result", parseChosenInlineResult(object->chosenInlineResult))
+ appendToJson(result, "chosen_inline_result", parseChosenInlineResult(object->chosenInlineResult));
result.erase(result.length() - 1);
result += '}';
return result;