2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

API scheme updated to layer 76.

This commit is contained in:
John Preston
2018-01-18 14:04:50 +03:00
parent 2dd2ad5cdb
commit d1a9d3992b
12 changed files with 183 additions and 89 deletions

View File

@@ -110,15 +110,18 @@ std::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
switch (message->type()) {
case mtpc_botInlineMessageMediaAuto: {
auto &r = message->c_botInlineMessageMediaAuto();
auto entities = r.has_entities()
? TextUtilities::EntitiesFromMTP(r.ventities.v)
: EntitiesInText();
if (result->_type == Type::Photo) {
result->createPhoto();
result->sendData = std::make_unique<internal::SendPhoto>(result->_photo, qs(r.vcaption));
result->sendData = std::make_unique<internal::SendPhoto>(result->_photo, qs(r.vmessage), entities);
} else if (result->_type == Type::Game) {
result->createGame();
result->sendData = std::make_unique<internal::SendGame>(result->_game);
} else {
result->createDocument();
result->sendData = std::make_unique<internal::SendFile>(result->_document, qs(r.vcaption));
result->sendData = std::make_unique<internal::SendFile>(result->_document, qs(r.vmessage), entities);
}
if (r.has_reply_markup()) {
result->_mtpKeyboard = std::make_unique<MTPReplyMarkup>(r.vreply_markup);
@@ -127,7 +130,9 @@ std::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
case mtpc_botInlineMessageText: {
auto &r = message->c_botInlineMessageText();
auto entities = r.has_entities() ? TextUtilities::EntitiesFromMTP(r.ventities.v) : EntitiesInText();
auto entities = r.has_entities()
? TextUtilities::EntitiesFromMTP(r.ventities.v)
: EntitiesInText();
result->sendData = std::make_unique<internal::SendText>(qs(r.vmessage), entities, r.is_no_webpage());
if (result->_type == Type::Photo) {
result->createPhoto();