From 45f46c60f6253a4b7c0cebf047983dd7cfce1683 Mon Sep 17 00:00:00 2001 From: Andrea Giove Date: Wed, 6 Apr 2016 18:26:16 +0200 Subject: Added certificate to setWebhook method --- src/Api.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Api.cpp b/src/Api.cpp index ed06d27..4070230 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -249,9 +249,13 @@ vector Api::getUpdates(int32_t offset, int32_t limit, int32_t timeo return TgTypeParser::getInstance().parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetUpdate, sendRequest("getUpdates", args)); } -void Api::setWebhook(const string& url) const { +void Api::setWebhook(const string& url, const InputFile::Ptr& certificate) const { vector args; - args.push_back(HttpReqArg("url", url)); + if (!url.empty()) + args.push_back(HttpReqArg("url", url)); + if (certificate != nullptr) + args.push_back(HttpReqArg("certificate", certificate->data, true, certificate->mimeType, certificate->fileName)); + sendRequest("setWebhook", args); } -- cgit v1.2.3