2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Game bot confirmations added.

This commit is contained in:
John Preston
2016-09-15 22:15:49 +03:00
parent 578cf4ed61
commit 6d2fc5c642
11 changed files with 4316 additions and 4167 deletions

View File

@@ -5783,8 +5783,16 @@ void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button
bool lastKeyboardUsed = (_keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard.forMsgId() == FullMsgId(_channel, msg->id));
auto bot = msg->viaBot();
if (!bot) {
bot = msg->from()->asUser();
if (bot && !bot->botInfo) {
bot = nullptr;
}
}
using ButtonType = HistoryMessageReplyMarkup::Button::Type;
BotCallbackInfo info = { msg->fullId(), row, col, (button->type == ButtonType::Game) };
BotCallbackInfo info = { bot, msg->fullId(), row, col, (button->type == ButtonType::Game) };
MTPmessages_GetBotCallbackAnswer::Flags flags = 0;
QByteArray sendData;
int32 sendGameId = 0;
@@ -5833,8 +5841,10 @@ void HistoryWidget::botCallbackDone(BotCallbackInfo info, const MTPmessages_BotC
auto url = qs(answerData.vurl);
if (info.game) {
url = appendShareGameScoreUrl(url, info.msgId);
BotGameUrlClickHandler(info.bot, url).onClick(Qt::LeftButton);
} else {
UrlClickHandler(url).onClick(Qt::LeftButton);
}
UrlClickHandler(url).onClick(Qt::LeftButton);
}
}
}