2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Merge branch 'game_media' into player

Conflicts:
	Telegram/Resources/basic.style
	Telegram/SourceFiles/media/player/media_player_list.cpp
	Telegram/SourceFiles/title.cpp
This commit is contained in:
John Preston
2016-09-30 20:07:56 +03:00
110 changed files with 712 additions and 541 deletions

View File

@@ -3454,6 +3454,7 @@ void HistoryWidget::updateSendAction(History *history, SendActionType type, int3
case SendActionUploadFile: action = MTP_sendMessageUploadDocumentAction(MTP_int(progress)); break;
case SendActionChooseLocation: action = MTP_sendMessageGeoLocationAction(); break;
case SendActionChooseContact: action = MTP_sendMessageChooseContactAction(); break;
case SendActionPlayGame: action = MTP_sendMessageGamePlayAction(); break;
}
_sendActionRequests.insert(qMakePair(history, type), MTP::send(MTPmessages_SetTyping(history->peer->input, action), rpcDone(&HistoryWidget::sendActionDone)));
if (type == SendActionTyping) _sendActionStopTimer.start(5000);
@@ -5817,7 +5818,8 @@ void HistoryWidget::app_sendBotCallback(const HistoryMessageReplyMarkup::Button
}
void HistoryWidget::botCallbackDone(BotCallbackInfo info, const MTPmessages_BotCallbackAnswer &answer, mtpRequestId req) {
if (auto item = App::histItemById(info.msgId)) {
auto item = App::histItemById(info.msgId);
if (item) {
if (auto markup = item->Get<HistoryMessageReplyMarkup>()) {
if (info.row < markup->rows.size() && info.col < markup->rows.at(info.row).size()) {
if (markup->rows.at(info.row).at(info.col).requestId == req) {
@@ -5842,6 +5844,9 @@ void HistoryWidget::botCallbackDone(BotCallbackInfo info, const MTPmessages_BotC
if (info.game) {
url = appendShareGameScoreUrl(url, info.msgId);
BotGameUrlClickHandler(info.bot, url).onClick(Qt::LeftButton);
if (item && (!item->history()->peer->isChannel() || item->history()->peer->isMegagroup())) {
updateSendAction(item->history(), SendActionPlayGame);
}
} else {
UrlClickHandler(url).onClick(Qt::LeftButton);
}