From f9d24932cc960eeae32e049fc271fa6fa01327c3 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:50:12 +0200 Subject: Fix #230 --- src/Api.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Api.cpp b/src/Api.cpp index 875a79a..e13fa7c 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -880,7 +880,7 @@ Message::Ptr Api::sendContact(boost::variant c Message::Ptr Api::sendPoll(boost::variant chatId, const std::string& question, - const StringArrayPtr& options, + const std::vector& options, bool disableNotification, std::int32_t replyToMessageId, GenericReply::Ptr replyMarkup, @@ -903,8 +903,8 @@ Message::Ptr Api::sendPoll(boost::variant chat args.emplace_back("question", question); args.emplace_back("options", _tgTypeParser.parseArray( [](const std::string& option)->std::string { - return "\"" + StringTools::urlEncode(option) + "\""; - }, *options)); + return "\"" + option + "\""; + }, options)); if (!isAnonymous) { args.emplace_back("is_anonymous", isAnonymous); } @@ -1755,13 +1755,13 @@ StickerSet::Ptr Api::getStickerSet(const std::string& name) const { return _tgTypeParser.parseJsonAndGetStickerSet(sendRequest("getStickerSet", args)); } -std::vector Api::getCustomEmojiStickers(const StringArrayPtr& customEmojiIds) const { +std::vector Api::getCustomEmojiStickers(const std::vector& customEmojiIds) const { std::vector args; args.reserve(1); args.emplace_back("custom_emoji_ids", _tgTypeParser.parseArray([] (const std::string& customEmojiId) -> std::string { - return "\"" + StringTools::urlEncode(customEmojiId) + "\""; - }, *customEmojiIds)); + return "\"" + customEmojiId + "\""; + }, customEmojiIds)); return _tgTypeParser.parseJsonAndGetArray(&TgTypeParser::parseJsonAndGetSticker, sendRequest("getCustomEmojiStickers", args)); } -- cgit v1.2.3