From a18e3e5616a81271a2a8a1cfbc090930292961d8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 30 Sep 2016 16:40:22 +0300 Subject: [PATCH] Game play send message action is supported. --- Telegram/Resources/langs/lang.strings | 8 +- Telegram/SourceFiles/history.cpp | 77 ++++++++++++++------ Telegram/SourceFiles/history.h | 5 +- Telegram/SourceFiles/historywidget.cpp | 5 +- Telegram/SourceFiles/mtproto/scheme.tl | 4 +- Telegram/SourceFiles/mtproto/scheme_auto.cpp | 15 +++- Telegram/SourceFiles/mtproto/scheme_auto.h | 50 ++++++++++--- 7 files changed, 125 insertions(+), 39 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 784d7cbc0..9573d6a0c 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -787,10 +787,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_typing" = "{user} is typing"; "lng_users_typing" = "{user} and {second_user} are typing"; "lng_many_typing" = "{count:_not_used_|# is|# are} typing"; -"lng_playing_game" = "playing game"; -"lng_user_playing_game" = "{user} is playing game"; -"lng_users_playing_game" = "{user} and {second_user} are playing game"; -"lng_many_playing_game" = "{count:_not_used_|# is|# are} playing game"; +"lng_playing_game" = "playing a game"; +"lng_user_playing_game" = "{user} is playing a game"; +"lng_users_playing_game" = "{user} and {second_user} are playing a game"; +"lng_many_playing_game" = "{count:_not_used_|# is|# are} playing a game"; "lng_send_action_record_video" = "recording a video"; "lng_user_action_record_video" = "{user} is recording a video"; "lng_send_action_upload_video" = "sending a video"; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 7faf04fb4..1a5168df7 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -171,7 +171,7 @@ void History::draftSavedToCloud() { bool History::updateTyping(uint64 ms, bool force) { bool changed = force; - for (TypingUsers::iterator i = typing.begin(), e = typing.end(); i != e;) { + for (auto i = typing.begin(), e = typing.end(); i != e;) { if (ms >= i.value()) { i = typing.erase(i); changed = true; @@ -179,7 +179,7 @@ bool History::updateTyping(uint64 ms, bool force) { ++i; } } - for (SendActionUsers::iterator i = sendActions.begin(); i != sendActions.cend();) { + for (auto i = sendActions.begin(); i != sendActions.cend();) { if (ms >= i.value().until) { i = sendActions.erase(i); changed = true; @@ -189,23 +189,46 @@ bool History::updateTyping(uint64 ms, bool force) { } if (changed) { QString newTypingStr; - int32 cnt = typing.size(); - if (cnt > 2) { - newTypingStr = lng_many_typing(lt_count, cnt); - } else if (cnt > 1) { + int typingCount = typing.size(); + if (typingCount > 2) { + newTypingStr = lng_many_typing(lt_count, typingCount); + } else if (typingCount > 1) { newTypingStr = lng_users_typing(lt_user, typing.begin().key()->firstName, lt_second_user, (typing.end() - 1).key()->firstName); - } else if (cnt) { + } else if (typingCount) { newTypingStr = peer->isUser() ? lang(lng_typing) : lng_user_typing(lt_user, typing.begin().key()->firstName); } else if (!sendActions.isEmpty()) { - switch (sendActions.begin().value().type) { - case SendActionRecordVideo: newTypingStr = peer->isUser() ? lang(lng_send_action_record_video) : lng_user_action_record_video(lt_user, sendActions.begin().key()->firstName); break; - case SendActionUploadVideo: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_video) : lng_user_action_upload_video(lt_user, sendActions.begin().key()->firstName); break; - case SendActionRecordVoice: newTypingStr = peer->isUser() ? lang(lng_send_action_record_audio) : lng_user_action_record_audio(lt_user, sendActions.begin().key()->firstName); break; - case SendActionUploadVoice: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_audio) : lng_user_action_upload_audio(lt_user, sendActions.begin().key()->firstName); break; - case SendActionUploadPhoto: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_photo) : lng_user_action_upload_photo(lt_user, sendActions.begin().key()->firstName); break; - case SendActionUploadFile: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_file) : lng_user_action_upload_file(lt_user, sendActions.begin().key()->firstName); break; - case SendActionChooseLocation: newTypingStr = peer->isUser() ? lang(lng_send_action_geo_location) : lng_user_action_geo_location(lt_user, sendActions.begin().key()->firstName); break; - case SendActionChooseContact: newTypingStr = peer->isUser() ? lang(lng_send_action_choose_contact) : lng_user_action_choose_contact(lt_user, sendActions.begin().key()->firstName); break; + // Handles all actions except game playing. + auto sendActionString = [](SendActionType type, const QString &name) -> QString { + switch (type) { + case SendActionRecordVideo: return name.isEmpty() ? lang(lng_send_action_record_video) : lng_user_action_record_video(lt_user, name); + case SendActionUploadVideo: return name.isEmpty() ? lang(lng_send_action_upload_video) : lng_user_action_upload_video(lt_user, name); + case SendActionRecordVoice: return name.isEmpty() ? lang(lng_send_action_record_audio) : lng_user_action_record_audio(lt_user, name); + case SendActionUploadVoice: return name.isEmpty() ? lang(lng_send_action_upload_audio) : lng_user_action_upload_audio(lt_user, name); + case SendActionUploadPhoto: return name.isEmpty() ? lang(lng_send_action_upload_photo) : lng_user_action_upload_photo(lt_user, name); + case SendActionUploadFile: return name.isEmpty() ? lang(lng_send_action_upload_file) : lng_user_action_upload_file(lt_user, name); + case SendActionChooseLocation: return name.isEmpty() ? lang(lng_send_action_geo_location) : lng_user_action_geo_location(lt_user, name); + case SendActionChooseContact: return name.isEmpty() ? lang(lng_send_action_choose_contact) : lng_user_action_choose_contact(lt_user, name); + default: break; + }; + return QString(); + }; + for (auto i = sendActions.cbegin(), e = sendActions.cend(); i != e; ++i) { + newTypingStr = sendActionString(i->type, peer->isUser() ? QString() : i.key()->firstName); + if (!newTypingStr.isEmpty()) { + break; + } + } + + // Everyone in sendActions are playing a game. + if (newTypingStr.isEmpty()) { + int playingCount = sendActions.size(); + if (playingCount > 2) { + newTypingStr = lng_many_playing_game(lt_count, playingCount); + } else if (playingCount > 1) { + newTypingStr = lng_users_playing_game(lt_user, sendActions.begin().key()->firstName, lt_second_user, (sendActions.end() - 1).key()->firstName); + } else { + newTypingStr = peer->isUser() ? lang(lng_playing_game) : lng_user_playing_game(lt_user, sendActions.begin().key()->firstName); + } } } if (!newTypingStr.isEmpty()) { @@ -527,6 +550,12 @@ void Histories::regSendAction(History *history, UserData *user, const MTPSendMes if (action.type() == mtpc_sendMessageCancelAction) { history->unregTyping(user); return; + } else if (action.type() == mtpc_sendMessageGameStopAction) { + auto it = history->sendActions.find(user); + if (it != history->sendActions.end() && it->type == SendActionPlayGame) { + history->unregTyping(user); + } + return; } uint64 ms = getms(); @@ -540,12 +569,18 @@ void Histories::regSendAction(History *history, UserData *user, const MTPSendMes case mtpc_sendMessageUploadDocumentAction: history->sendActions.insert(user, SendAction(SendActionUploadFile, ms + 6000, action.c_sendMessageUploadDocumentAction().vprogress.v)); break; case mtpc_sendMessageGeoLocationAction: history->sendActions.insert(user, SendAction(SendActionChooseLocation, ms + 6000)); break; case mtpc_sendMessageChooseContactAction: history->sendActions.insert(user, SendAction(SendActionChooseContact, ms + 6000)); break; + case mtpc_sendMessageGamePlayAction: { + auto it = history->sendActions.find(user); + if (it == history->sendActions.end() || it->type == SendActionPlayGame || it->until <= ms) { + history->sendActions.insert(user, SendAction(SendActionPlayGame, ms + 30000)); + } + } break; default: return; } user->madeAction(when); - TypingHistories::const_iterator i = typing.find(history); + auto i = typing.find(history); if (i == typing.cend()) { typing.insert(history, ms); history->typingDots = 0; @@ -1059,13 +1094,13 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) { void History::unregTyping(UserData *from) { uint64 updateAtMs = 0; - TypingUsers::iterator i = typing.find(from); - if (i != typing.end()) { + auto i = typing.find(from); + if (i != typing.cend()) { updateAtMs = getms(); i.value() = updateAtMs; } - SendActionUsers::iterator j = sendActions.find(from); - if (j != sendActions.end()) { + auto j = sendActions.find(from); + if (j != sendActions.cend()) { if (!updateAtMs) updateAtMs = getms(); j.value().until = updateAtMs; } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index db8cefa65..6dd45ecd8 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -142,6 +142,7 @@ enum SendActionType { SendActionUploadFile, SendActionChooseLocation, SendActionChooseContact, + SendActionPlayGame, }; struct SendAction { SendAction(SendActionType type, uint64 until, int32 progress = 0) : type(type), until(until), progress(progress) { @@ -401,9 +402,9 @@ public: mutable const HistoryItem *textCachedFor = nullptr; // cache mutable Text lastItemTextCache; - typedef QMap TypingUsers; + using TypingUsers = QMap; TypingUsers typing; - typedef QMap SendActionUsers; + using SendActionUsers = QMap; SendActionUsers sendActions; QString typingStr; Text typingText; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 8e0ce3af9..b1e191aa7 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -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()) { 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,7 @@ void HistoryWidget::botCallbackDone(BotCallbackInfo info, const MTPmessages_BotC if (info.game) { url = appendShareGameScoreUrl(url, info.msgId); BotGameUrlClickHandler(info.bot, url).onClick(Qt::LeftButton); + updateSendAction(item->history(), SendActionPlayGame); } else { UrlClickHandler(url).onClick(Qt::LeftButton); } diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index a68bf1fc4..c6887c5a2 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -479,6 +479,8 @@ sendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction; sendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction; sendMessageGeoLocationAction#176f8ba1 = SendMessageAction; sendMessageChooseContactAction#628cbc6f = SendMessageAction; +sendMessageGamePlayAction#dd6a8f48 = SendMessageAction; +sendMessageGameStopAction#15c2c99a = SendMessageAction; contacts.found#1aa1f784 results:Vector chats:Vector users:Vector = contacts.Found; @@ -649,7 +651,7 @@ inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:strin inputBotInlineMessageMediaGeo#f4a59de1 flags:# geo_point:InputGeoPoint reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaVenue#aaafadc8 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineMessageMediaContact#2daf01a7 flags:# phone_number:string first_name:string last_name:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; -inputBotInlineMessageGame#3c00f8aa reply_markup:ReplyMarkup = InputBotInlineMessage; +inputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage; inputBotInlineResult#2cbbe15a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb_url:flags.4?string content_url:flags.5?string content_type:flags.5?string w:flags.6?int h:flags.6?int duration:flags.7?int send_message:InputBotInlineMessage = InputBotInlineResult; inputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult; diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp index 4d9b5e892..66dc94129 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -3896,6 +3896,14 @@ void _serialize_sendMessageChooseContactAction(MTPStringLogger &to, int32 stage, to.add("{ sendMessageChooseContactAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } +void _serialize_sendMessageGamePlayAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ sendMessageGamePlayAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + +void _serialize_sendMessageGameStopAction(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + to.add("{ sendMessageGameStopAction }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); +} + void _serialize_contacts_found(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5387,6 +5395,8 @@ void _serialize_inputBotInlineMessageMediaContact(MTPStringLogger &to, int32 sta } void _serialize_inputBotInlineMessageGame(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + MTPDinputBotInlineMessageGame::Flags flag(iflag); + if (stage) { to.add(",\n").addSpaces(lev); } else { @@ -5394,7 +5404,8 @@ void _serialize_inputBotInlineMessageGame(MTPStringLogger &to, int32 stage, int3 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" reply_markup: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_flags); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDinputBotInlineMessageGame::Flag::f_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -9144,6 +9155,8 @@ namespace { _serializers.insert(mtpc_sendMessageUploadDocumentAction, _serialize_sendMessageUploadDocumentAction); _serializers.insert(mtpc_sendMessageGeoLocationAction, _serialize_sendMessageGeoLocationAction); _serializers.insert(mtpc_sendMessageChooseContactAction, _serialize_sendMessageChooseContactAction); + _serializers.insert(mtpc_sendMessageGamePlayAction, _serialize_sendMessageGamePlayAction); + _serializers.insert(mtpc_sendMessageGameStopAction, _serialize_sendMessageGameStopAction); _serializers.insert(mtpc_contacts_found, _serialize_contacts_found); _serializers.insert(mtpc_inputPrivacyKeyStatusTimestamp, _serialize_inputPrivacyKeyStatusTimestamp); _serializers.insert(mtpc_inputPrivacyKeyChatInvite, _serialize_inputPrivacyKeyChatInvite); diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.h b/Telegram/SourceFiles/mtproto/scheme_auto.h index 66f7527d5..d72360477 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -353,6 +353,8 @@ enum { mtpc_sendMessageUploadDocumentAction = 0xaa0cd9e4, mtpc_sendMessageGeoLocationAction = 0x176f8ba1, mtpc_sendMessageChooseContactAction = 0x628cbc6f, + mtpc_sendMessageGamePlayAction = 0xdd6a8f48, + mtpc_sendMessageGameStopAction = 0x15c2c99a, mtpc_contacts_found = 0x1aa1f784, mtpc_inputPrivacyKeyStatusTimestamp = 0x4f96cb18, mtpc_inputPrivacyKeyChatInvite = 0xbdfb0426, @@ -474,7 +476,7 @@ enum { mtpc_inputBotInlineMessageMediaGeo = 0xf4a59de1, mtpc_inputBotInlineMessageMediaVenue = 0xaaafadc8, mtpc_inputBotInlineMessageMediaContact = 0x2daf01a7, - mtpc_inputBotInlineMessageGame = 0x3c00f8aa, + mtpc_inputBotInlineMessageGame = 0x4b425864, mtpc_inputBotInlineResult = 0x2cbbe15a, mtpc_inputBotInlineResultPhoto = 0xa8d864a7, mtpc_inputBotInlineResultDocument = 0xfff8fdc4, @@ -14639,11 +14641,22 @@ public: class MTPDinputBotInlineMessageGame : public mtpDataImpl { public: + enum class Flag : int32 { + f_reply_markup = (1 << 2), + + MAX_FIELD = (1 << 2), + }; + Q_DECLARE_FLAGS(Flags, Flag); + friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } + + bool has_reply_markup() const { return vflags.v & Flag::f_reply_markup; } + MTPDinputBotInlineMessageGame() { } - MTPDinputBotInlineMessageGame(const MTPReplyMarkup &_reply_markup) : vreply_markup(_reply_markup) { + MTPDinputBotInlineMessageGame(const MTPflags &_flags, const MTPReplyMarkup &_reply_markup) : vflags(_flags), vreply_markup(_reply_markup) { } + MTPflags vflags; MTPReplyMarkup vreply_markup; }; @@ -24778,6 +24791,12 @@ public: inline static MTPsendMessageAction new_sendMessageChooseContactAction() { return MTPsendMessageAction(mtpc_sendMessageChooseContactAction); } + inline static MTPsendMessageAction new_sendMessageGamePlayAction() { + return MTPsendMessageAction(mtpc_sendMessageGamePlayAction); + } + inline static MTPsendMessageAction new_sendMessageGameStopAction() { + return MTPsendMessageAction(mtpc_sendMessageGameStopAction); + } inline static MTPcontacts_found new_contacts_found(const MTPVector &_results, const MTPVector &_chats, const MTPVector &_users) { return MTPcontacts_found(new MTPDcontacts_found(_results, _chats, _users)); } @@ -25141,8 +25160,8 @@ public: inline static MTPinputBotInlineMessage new_inputBotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup)); } - inline static MTPinputBotInlineMessage new_inputBotInlineMessageGame(const MTPReplyMarkup &_reply_markup) { - return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageGame(_reply_markup)); + inline static MTPinputBotInlineMessage new_inputBotInlineMessageGame(const MTPflags &_flags, const MTPReplyMarkup &_reply_markup) { + return MTPinputBotInlineMessage(new MTPDinputBotInlineMessageGame(_flags, _reply_markup)); } inline static MTPinputBotInlineResult new_inputBotInlineResult(const MTPflags &_flags, const MTPstring &_id, const MTPstring &_type, const MTPstring &_title, const MTPstring &_description, const MTPstring &_url, const MTPstring &_thumb_url, const MTPstring &_content_url, const MTPstring &_content_type, MTPint _w, MTPint _h, MTPint _duration, const MTPInputBotInlineMessage &_send_message) { return MTPinputBotInlineResult(new MTPDinputBotInlineResult(_flags, _id, _type, _title, _description, _url, _thumb_url, _content_url, _content_type, _w, _h, _duration, _send_message)); @@ -32738,6 +32757,8 @@ inline void MTPsendMessageAction::read(const mtpPrime *&from, const mtpPrime *en } break; case mtpc_sendMessageGeoLocationAction: _type = cons; break; case mtpc_sendMessageChooseContactAction: _type = cons; break; + case mtpc_sendMessageGamePlayAction: _type = cons; break; + case mtpc_sendMessageGameStopAction: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPsendMessageAction"); } } @@ -32773,6 +32794,8 @@ inline MTPsendMessageAction::MTPsendMessageAction(mtpTypeId type) : mtpDataOwner case mtpc_sendMessageUploadDocumentAction: setData(new MTPDsendMessageUploadDocumentAction()); break; case mtpc_sendMessageGeoLocationAction: break; case mtpc_sendMessageChooseContactAction: break; + case mtpc_sendMessageGamePlayAction: break; + case mtpc_sendMessageGameStopAction: break; default: throw mtpErrorBadTypeId(type, "MTPsendMessageAction"); } } @@ -32814,6 +32837,12 @@ inline MTPsendMessageAction MTP_sendMessageGeoLocationAction() { inline MTPsendMessageAction MTP_sendMessageChooseContactAction() { return MTP::internal::TypeCreator::new_sendMessageChooseContactAction(); } +inline MTPsendMessageAction MTP_sendMessageGamePlayAction() { + return MTP::internal::TypeCreator::new_sendMessageGamePlayAction(); +} +inline MTPsendMessageAction MTP_sendMessageGameStopAction() { + return MTP::internal::TypeCreator::new_sendMessageGameStopAction(); +} inline MTPcontacts_found::MTPcontacts_found() : mtpDataOwner(new MTPDcontacts_found()) { } @@ -35653,7 +35682,7 @@ inline uint32 MTPinputBotInlineMessage::innerLength() const { } case mtpc_inputBotInlineMessageGame: { const MTPDinputBotInlineMessageGame &v(c_inputBotInlineMessageGame()); - return v.vreply_markup.innerLength(); + return v.vflags.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0); } } return 0; @@ -35710,7 +35739,8 @@ inline void MTPinputBotInlineMessage::read(const mtpPrime *&from, const mtpPrime case mtpc_inputBotInlineMessageGame: _type = cons; { if (!data) setData(new MTPDinputBotInlineMessageGame()); MTPDinputBotInlineMessageGame &v(_inputBotInlineMessageGame()); - v.vreply_markup.read(from, end); + v.vflags.read(from, end); + if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } } break; default: throw mtpErrorUnexpected(cons, "MTPinputBotInlineMessage"); } @@ -35756,7 +35786,8 @@ inline void MTPinputBotInlineMessage::write(mtpBuffer &to) const { } break; case mtpc_inputBotInlineMessageGame: { const MTPDinputBotInlineMessageGame &v(c_inputBotInlineMessageGame()); - v.vreply_markup.write(to); + v.vflags.write(to); + if (v.has_reply_markup()) v.vreply_markup.write(to); } break; } } @@ -35803,8 +35834,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageMediaContact::Flags) inline MTPinputBotInlineMessage MTP_inputBotInlineMessageMediaContact(const MTPflags &_flags, const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name, const MTPReplyMarkup &_reply_markup) { return MTP::internal::TypeCreator::new_inputBotInlineMessageMediaContact(_flags, _phone_number, _first_name, _last_name, _reply_markup); } -inline MTPinputBotInlineMessage MTP_inputBotInlineMessageGame(const MTPReplyMarkup &_reply_markup) { - return MTP::internal::TypeCreator::new_inputBotInlineMessageGame(_reply_markup); +Q_DECLARE_OPERATORS_FOR_FLAGS(MTPDinputBotInlineMessageGame::Flags) +inline MTPinputBotInlineMessage MTP_inputBotInlineMessageGame(const MTPflags &_flags, const MTPReplyMarkup &_reply_markup) { + return MTP::internal::TypeCreator::new_inputBotInlineMessageGame(_flags, _reply_markup); } inline uint32 MTPinputBotInlineResult::innerLength() const {