diff options
author | Andrea Giove <andreagiove@outlook.com> | 2016-04-06 18:26:16 +0200 |
---|---|---|
committer | Andrea Giove <andreagiove@outlook.com> | 2016-04-06 18:26:16 +0200 |
commit | 45f46c60f6253a4b7c0cebf047983dd7cfce1683 (patch) | |
tree | fbf00d9c991f2d41ae8c889825d5accdd2514e7d /src | |
parent | b2e4048cf9ce6d4dc4969a52cffc2ad36ec19f21 (diff) |
Added certificate to setWebhook method
Diffstat (limited to 'src')
-rw-r--r-- | src/Api.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<Update::Ptr> Api::getUpdates(int32_t offset, int32_t limit, int32_t timeo return TgTypeParser::getInstance().parseJsonAndGetArray<Update>(&TgTypeParser::parseJsonAndGetUpdate, sendRequest("getUpdates", args)); } -void Api::setWebhook(const string& url) const { +void Api::setWebhook(const string& url, const InputFile::Ptr& certificate) const { vector<HttpReqArg> 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); } |