From c0bdc0257ed96d76bd9cdf9d58a6adcc67415503 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 Nov 2023 22:27:50 +0400 Subject: [PATCH] wip --- Telegram/SourceFiles/api/api_peer_photo.cpp | 22 ++++++------ Telegram/SourceFiles/api/api_polls.cpp | 2 +- Telegram/SourceFiles/api/api_premium.cpp | 17 +++++++++ Telegram/SourceFiles/api/api_sending.cpp | 36 ++++++++++++------- Telegram/SourceFiles/api/api_sending.h | 12 +++++-- Telegram/SourceFiles/apiwrap.cpp | 8 ++--- .../boxes/peers/edit_peer_color_box.cpp | 3 ++ .../boxes/reactions_settings_box.cpp | 2 ++ Telegram/SourceFiles/boxes/share_box.cpp | 3 +- Telegram/SourceFiles/data/data_drafts.cpp | 1 - .../giveaway/giveaway_list_controllers.cpp | 2 ++ .../inline_bots/bot_attach_web_view.cpp | 4 +-- Telegram/SourceFiles/main/main_app_config.cpp | 4 +++ Telegram/SourceFiles/main/main_app_config.h | 2 ++ .../media/stories/media_stories_share.cpp | 3 +- .../SourceFiles/payments/payments_form.cpp | 2 ++ Telegram/SourceFiles/payments/payments_form.h | 2 ++ .../support/support_autocomplete.cpp | 4 ++- .../SourceFiles/window/window_peer_menu.cpp | 4 +-- 19 files changed, 94 insertions(+), 39 deletions(-) diff --git a/Telegram/SourceFiles/api/api_peer_photo.cpp b/Telegram/SourceFiles/api/api_peer_photo.cpp index 31ee26cebdf22e..3e9943c057ca7d 100644 --- a/Telegram/SourceFiles/api/api_peer_photo.cpp +++ b/Telegram/SourceFiles/api/api_peer_photo.cpp @@ -734,20 +734,20 @@ void PeerPhoto::requestEmojiList(EmojiListType type) { const auto send = [&](auto &&request) { return _api.request( std::move(request) - ).done([=](const MTPEmojiList &result) { + ).done([=](const TLstickers &result) { auto &list = emojiList(type); list.requestId = 0; - const auto &stickers = data.vstickers().v; - list.list = EmojiList(); - list.list.reserve(stickers.size()); - for (const auto &sticker : stickers) { - const auto document = _session->data().processDocument( - sticker); - if (document->sticker()) { - list.list.push_back(document->id); - } - } + const auto &stickers = result.data().vstickers().v; + list.list = ranges::views::all( + result.data().vstickers().v + ) | ranges::view::transform([&](const TLsticker &sticker) { + return _session->data().processDocument(sticker); + }) | ranges::views::filter([](not_null sticker) { + return sticker->sticker() != nullptr; + }) | ranges::views::transform( + &DocumentData::id + ) | ranges::to_vector; }).fail([=] { emojiList(type).requestId = 0; }).send(); diff --git a/Telegram/SourceFiles/api/api_polls.cpp b/Telegram/SourceFiles/api/api_polls.cpp index f66677006f6a5c..953812894ffa7f 100644 --- a/Telegram/SourceFiles/api/api_polls.cpp +++ b/Telegram/SourceFiles/api/api_polls.cpp @@ -80,7 +80,7 @@ void Polls::create( _api.request(Tdb::TLsendMessage( peerToTdbChat(peer->id), - Tdb::tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(peer, action), MessageReplyTo(action), MessageSendOptions(peer, action), PollToTL(&data) diff --git a/Telegram/SourceFiles/api/api_premium.cpp b/Telegram/SourceFiles/api/api_premium.cpp index f636b4fc310b9d..b1022c1731a06e 100644 --- a/Telegram/SourceFiles/api/api_premium.cpp +++ b/Telegram/SourceFiles/api/api_premium.cpp @@ -30,6 +30,7 @@ namespace { using namespace Tdb; +#if 0 // mtp [[nodiscard]] GiftCode Parse(const MTPDpayments_checkedGiftCode &data) { return { .from = peerFromMTP(data.vfrom_id()), @@ -59,6 +60,7 @@ using namespace Tdb; } return options; } +#endif } // namespace @@ -398,6 +400,7 @@ void Premium::checkGiftCode( _api.request(_giftCodeRequestId).cancel(); } _giftCodeSlug = slug; +#if 0 // todo _giftCodeRequestId = _api.request(MTPpayments_CheckGiftCode( MTP_string(slug) )).done([=](const MTPpayments_CheckedGiftCode &result) { @@ -412,6 +415,7 @@ void Premium::checkGiftCode( done(updateGiftCode(slug, {})); }).send(); +#endif } GiftCode Premium::updateGiftCode( @@ -435,6 +439,7 @@ rpl::producer Premium::giftCodeValue(const QString &slug) const { } void Premium::applyGiftCode(const QString &slug, Fn done) { +#if 0 // todo _api.request(MTPpayments_ApplyGiftCode( MTP_string(slug) )).done([=](const MTPUpdates &result) { @@ -443,6 +448,7 @@ void Premium::applyGiftCode(const QString &slug, Fn done) { }).fail([=](const MTP::Error &error) { done(error.type()); }).send(); +#endif } void Premium::resolveGiveawayInfo( @@ -461,6 +467,7 @@ void Premium::resolveGiveawayInfo( } _giveawayInfoPeer = peer; _giveawayInfoMessageId = messageId; +#if 0 // todo _giveawayInfoRequestId = _api.request(MTPpayments_GetGiveawayInfo( _giveawayInfoPeer->input, MTP_int(_giveawayInfoMessageId.bare) @@ -495,6 +502,7 @@ void Premium::resolveGiveawayInfo( _giveawayInfoRequestId = 0; _giveawayInfoDone({}); }).send(); +#endif } const Data::SubscriptionOptions &Premium::subscriptionOptions() const { @@ -503,7 +511,10 @@ const Data::SubscriptionOptions &Premium::subscriptionOptions() const { PremiumGiftCodeOptions::PremiumGiftCodeOptions(not_null peer) : _peer(peer) +#if 0 // mtp , _api(&peer->session().api().instance()) { +#endif +, _api(&peer->session().sender()) { } rpl::producer PremiumGiftCodeOptions::request() { @@ -514,6 +525,7 @@ rpl::producer PremiumGiftCodeOptions::request() { return lifetime; } +#if 0 // todo using TLOption = MTPPremiumGiftCodeOption; _api.request(MTPpayments_GetPremiumGiftCodeOptions( MTP_flags( @@ -552,6 +564,7 @@ rpl::producer PremiumGiftCodeOptions::request() { }).fail([=](const MTP::Error &error) { consumer.put_error_copy(error.type()); }).send(); +#endif return lifetime; }; @@ -567,6 +580,7 @@ rpl::producer PremiumGiftCodeOptions::applyPrepaid( return lifetime; } +#if 0 // todo _api.request(MTPpayments_LaunchPrepaidGiveaway( _peer->input, MTP_long(prepaidId), @@ -577,6 +591,7 @@ rpl::producer PremiumGiftCodeOptions::applyPrepaid( }).fail([=](const MTP::Error &error) { consumer.put_error_copy(error.type()); }).send(); +#endif return lifetime; }; @@ -612,6 +627,7 @@ Data::SubscriptionOptions PremiumGiftCodeOptions::options(int amount) { if (it != end(_subscriptionOptions)) { return it->second; } else { +#if 0 // todo auto tlOptions = QVector(); for (auto i = 0; i < _optionsForOnePerson.months.size(); i++) { tlOptions.push_back(MTP_premiumGiftCodeOption( @@ -624,6 +640,7 @@ Data::SubscriptionOptions PremiumGiftCodeOptions::options(int amount) { MTP_long(_optionsForOnePerson.totalCosts[i] * amount))); } _subscriptionOptions[amount] = GiftCodesFromTL(tlOptions); +#endif return _subscriptionOptions[amount]; } } diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 56d1f276e2d595..b6ce95a14f9366 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -414,16 +414,16 @@ void SendPreparedAlbumIfReady( const auto session = &peer->session(); session->sender().request(TLsendMessageAlbum( peerToTdbChat(peer->id), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(peer, action), MessageReplyTo(action), tl_messageSendOptions( tl_bool(silentPost), tl_bool(false), // from_background tl_bool(false), // update_order_of_installed_stickers_sets ScheduledToTL(action.options.scheduled), - tl_int32(0)), // sending_id - tl_vector(std::move(contents)), - tl_bool(false) // only_preview + tl_int32(0), // sending_id + tl_bool(false)), // only_preview + tl_vector(std::move(contents)) )).done([=](const TLmessages &result) { // They should've been added by updates. }).fail([=](const Error &error) { @@ -587,7 +587,7 @@ bool SendDice(MessageToSend &message) { const auto &action = message.action; session->sender().request(TLsendMessage( peerToTdbChat(peer->id), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(peer, action), MessageReplyTo(action), MessageSendOptions(peer, action), tl_inputMessageDice(tl_string(emoji), tl_bool(action.clearDraft)) @@ -888,23 +888,33 @@ TLmessageSendOptions MessageSendOptions( tl_bool(false), // from_background tl_bool(false), // update_order_of_installed_stickers_sets ScheduledToTL(action.options.scheduled), - tl_int32(sendingId)); + tl_int32(sendingId), + tl_bool(false)); // only_preview } -std::optional MessageReplyTo( +std::optional MessageReplyTo( const SendAction &action) { if (const auto &storyId = action.replyTo.storyId) { - return tl_messageReplyToStory( + return tl_inputMessageReplyToStory( peerToTdbChat(storyId.peer), tl_int32(storyId.story)); - } else if (const auto to = action.replyTo.msgId) { - return tl_messageReplyToMessage( - peerToTdbChat(action.history->peer->id), - tl_int53(to.bare)); + } else if (const auto to = action.replyTo.messageId) { + return tl_inputMessageReplyToMessage( + peerToTdbChat(to.peer), + tl_int53(to.msg.bare), + (action.replyTo.quote.empty() + ? std::optional() + : Api::FormattedTextToTdb(action.replyTo.quote))); } return std::nullopt; } +TLint53 MessageThreadId( + not_null peer, + const SendAction &action) { + return tl_int53(action.replyTo.topicRootId.bare); +} + void SendPreparedMessage( const SendAction &action, TLinputMessageContent content, @@ -924,7 +934,7 @@ void SendPreparedMessage( const auto sendingId = ClientMsgIndex(localId); session->sender().request(TLsendMessage( peerToTdbChat(peer->id), - tl_int53(topicRootId.bare), + MessageThreadId(peer, action), MessageReplyTo(action), MessageSendOptions(peer, action, sendingId), std::move(content) diff --git a/Telegram/SourceFiles/api/api_sending.h b/Telegram/SourceFiles/api/api_sending.h index 225c7d8068046a..f2a22372bd1a19 100644 --- a/Telegram/SourceFiles/api/api_sending.h +++ b/Telegram/SourceFiles/api/api_sending.h @@ -16,11 +16,16 @@ class PhotoData; class DocumentData; struct FileLoadResult; +namespace tl { +class int64_type; +} // namespace tl + namespace Tdb { class TLinputMessageContent; class TLmessageSchedulingState; class TLmessageSendOptions; -class TLmessageReplyTo; +class TLinputMessageReplyTo; +using TLint53 = tl::int64_type; } // namespace Tdb namespace InlineBots { @@ -57,7 +62,10 @@ void SendConfirmedFile( not_null peer, const SendAction &action, int32 sendingId = 0); -[[nodiscard]] std::optional MessageReplyTo( +[[nodiscard]] std::optional MessageReplyTo( + const SendAction &action); +[[nodiscard]] Tdb::TLint53 MessageThreadId( + not_null peer, const SendAction &action); void SendPreparedMessage( diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 27bdbc291d78ae..f467fbeb03aa94 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -4182,11 +4182,11 @@ void ApiWrap::forwardMessages( tl_bool(false), // from_background tl_bool(false), // update_order_of_installed_stickers_sets Api::ScheduledToTL(action.options.scheduled), - tl_int32(0)), // sending_id + tl_int32(0), // sending_id + tl_bool(false)), // only_preview tl_bool(draft.options != Data::ForwardOptions::PreserveInfo), tl_bool( - draft.options == Data::ForwardOptions::NoNamesAndCaptions), - tl_bool(false) // only_preview + draft.options == Data::ForwardOptions::NoNamesAndCaptions) )).done([=](const TLmessages &result) { // They should've been added by updates. }).fail([=](const Error &error) { @@ -4854,7 +4854,7 @@ void ApiWrap::sendInlineResult( const auto sendingId = ClientMsgIndex(localId); sender().request(TLsendInlineQueryResultMessage( peerToTdbChat(peer->id), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(peer, action), MessageReplyTo(action), MessageSendOptions(peer, action, sendingId), tl_int64(data->getQueryId()), diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp index 4d1c46bdd94c05..c08eae500c1802 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp @@ -803,6 +803,7 @@ void EditPeerColorBox( state->emojiId.value() ), {}); +#if 0 // todo const auto appConfig = &peer->session().account().appConfig(); auto indices = rpl::single( rpl::empty @@ -816,6 +817,8 @@ void EditPeerColorBox( return uint8(i); }) | ranges::to_vector; }); +#endif + auto indices = rpl::single(std::vector{ 0, 1, 2, 3, 4, 5, 6 }); const auto margin = st::settingsColorRadioMargin; const auto skip = st::settingsColorRadioSkip; box->addRow( diff --git a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp index f48201a0adc233..6cfda620ed6374 100644 --- a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp +++ b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp @@ -57,6 +57,8 @@ PeerId GenerateUser(not_null history, const QString &name) { Tdb::TLstring(), // phone_number Tdb::tl_userStatusEmpty(), // status Tdb::null, // profile_photo + Tdb::tl_int32(Data::DecideColorIndex(peerId)), + Tdb::tl_int64(0), // background_custom_emoji_id Tdb::null, // emoji_status Tdb::tl_bool(false), // is_contact Tdb::tl_bool(false), // is_mutual_contact diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 7a73453fd525f7..cc8852666004df 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1540,7 +1540,8 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback( tl_bool(true), // from_background. tl_bool(false), // update_order_of_installed_stickers_sets Api::ScheduledToTL(options.scheduled), - tl_int32(0)); + tl_int32(0), // sending_id + tl_bool(false)); // only_preview // If we have only one message to send // Then there is a chance we should send a game score. diff --git a/Telegram/SourceFiles/data/data_drafts.cpp b/Telegram/SourceFiles/data/data_drafts.cpp index d57f485d0f345a..0702d8eff21987 100644 --- a/Telegram/SourceFiles/data/data_drafts.cpp +++ b/Telegram/SourceFiles/data/data_drafts.cpp @@ -180,7 +180,6 @@ void ApplyPeerCloudDraft( auto cloudDraft = std::make_unique( textWithTags, replyTo, - topicRootId, MessageCursor(Ui::kQFixedMax, Ui::kQFixedMax, Ui::kQFixedMax), std::move(webpage)); cloudDraft->date = date; diff --git a/Telegram/SourceFiles/info/boosts/giveaway/giveaway_list_controllers.cpp b/Telegram/SourceFiles/info/boosts/giveaway/giveaway_list_controllers.cpp index 975dab5b3e1208..8315ae09163296 100644 --- a/Telegram/SourceFiles/info/boosts/giveaway/giveaway_list_controllers.cpp +++ b/Telegram/SourceFiles/info/boosts/giveaway/giveaway_list_controllers.cpp @@ -244,6 +244,7 @@ Main::Session &MyChannelsListController::session() const { void MyChannelsListController::prepare() { delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled); +#if 0 // todo const auto api = _apiLifetime.make_state( &session().api().instance()); api->request( @@ -285,6 +286,7 @@ void MyChannelsListController::prepare() { delegate()->peerListRefreshRows(); _selected.clear(); }).send(); +#endif } void MyChannelsListController::setCheckError(Fn callback) { diff --git a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp index c8c1d28e4f6499..ddaa3b10a62e64 100644 --- a/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp +++ b/Telegram/SourceFiles/inline_bots/bot_attach_web_view.cpp @@ -935,7 +935,7 @@ void AttachWebView::request(const WebViewButton &button) { tl_string(_startCommand.isEmpty() ? button.url : _startCommand), Window::Theme::WebViewTheme(), tl_string("tdesktop"), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(action.history->peer, action), MessageReplyTo(action) )).done([=](const TLwebAppInfo &result) { _requestId = 0; @@ -1394,7 +1394,7 @@ void AttachWebView::requestMenu( tl_string(url), Window::Theme::WebViewTheme(), tl_string("tdesktop"), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(action.history->peer, action), MessageReplyTo(action) )).done([=](const TLwebAppInfo &result) { _requestId = 0; diff --git a/Telegram/SourceFiles/main/main_app_config.cpp b/Telegram/SourceFiles/main/main_app_config.cpp index d8608c5367cec5..c41d7bd00c1dda 100644 --- a/Telegram/SourceFiles/main/main_app_config.cpp +++ b/Telegram/SourceFiles/main/main_app_config.cpp @@ -307,6 +307,7 @@ std::vector> AppConfig::getStringMapArray( }); } +#if 0 // mtp std::vector AppConfig::getIntArray( const QString &key, std::vector &&fallback) const { @@ -327,6 +328,7 @@ std::vector AppConfig::getIntArray( }); }); } +#endif bool AppConfig::suggestionCurrent(const QString &key) const { return !_dismissedSuggestions.contains(key) @@ -433,6 +435,7 @@ void AppConfig::parseColorIndices() { auto colors = std::make_shared< std::array>(); +#if 0 // todo getValue(u"peer_colors"_q, [&](const MTPJSONValue &value) { if (!checkColorsObjectType(value)) { return; @@ -454,6 +457,7 @@ void AppConfig::parseColorIndices() { } } }); +#endif if (!_colorIndicesCurrent) { _colorIndicesCurrent = std::make_unique( diff --git a/Telegram/SourceFiles/main/main_app_config.h b/Telegram/SourceFiles/main/main_app_config.h index 1ca772cf16bcf8..27c2e59defea9c 100644 --- a/Telegram/SourceFiles/main/main_app_config.h +++ b/Telegram/SourceFiles/main/main_app_config.h @@ -41,8 +41,10 @@ class AppConfig final { return getString(key, fallback); } else if constexpr (std::is_same_v>) { return getStringArray(key, std::move(fallback)); +#if 0 // mtp } else if constexpr (std::is_same_v>) { return getIntArray(key, std::move(fallback)); +#endif } else if constexpr (std::is_same_v< Type, std::vector>>) { diff --git a/Telegram/SourceFiles/media/stories/media_stories_share.cpp b/Telegram/SourceFiles/media/stories/media_stories_share.cpp index 99b7c4898c21a4..0da536891869ef 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_share.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_share.cpp @@ -151,7 +151,8 @@ using namespace Tdb; tl_bool(true), // from_background. tl_bool(false), // update_order_of_installed_stickers_sets Api::ScheduledToTL(action.options.scheduled), - tl_int32(0)); + tl_int32(0), // sending_id + tl_bool(false)); // only_preview sender.request(TLsendMessage( peerToTdbChat(threadPeer->id), tl_int53(action.replyTo.topicRootId.bare), diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index e7cb8354c10d0b..a2156e669f0875 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -178,6 +178,7 @@ not_null SessionFromId(const InvoiceId &id) { return &giveaway.boostPeer->session(); } +#if 0 // mtp MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL( const InvoicePremiumGiftCode &invoice) { const auto &giveaway = v::get( @@ -210,6 +211,7 @@ MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL( MTP_string(invoice.currency), MTP_long(invoice.amount)); } +#endif Form::Form(InvoiceId id, bool receipt) : _id(id) diff --git a/Telegram/SourceFiles/payments/payments_form.h b/Telegram/SourceFiles/payments/payments_form.h index d9d3aeb0e230a3..2974b51d53d1fe 100644 --- a/Telegram/SourceFiles/payments/payments_form.h +++ b/Telegram/SourceFiles/payments/payments_form.h @@ -242,8 +242,10 @@ struct InvoiceId { [[nodiscard]] not_null SessionFromId(const InvoiceId &id); +#if 0 // mtp [[nodiscard]] MTPinputStorePaymentPurpose InvoicePremiumGiftCodeGiveawayToTL( const InvoicePremiumGiftCode &invoice); +#endif class Form final : public base::has_weak_ptr { public: diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index 8d3f57def92b7f..1cc5b701f929e1 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -340,6 +340,7 @@ AdminLog::OwnedItem GenerateContactItem( tl_bool(false), // is_pinned tl_bool(false), // can_be_edited tl_bool(false), // can_be_forwarded + tl_bool(false), // can_be_replied_in_another_chat tl_bool(true), // can_be_saved tl_bool(true), // can_be_deleted_only_for_self tl_bool(false), // can_be_deleted_for_all_users @@ -356,12 +357,13 @@ AdminLog::OwnedItem GenerateContactItem( tl_int32(base::unixtime::now()), // date tl_int32(0), // edit_date tl_messageForwardInfo( - tl_messageForwardOriginUser( + tl_messageOriginUser( tl_int53(history->session().userId().bare)), tl_int32(base::unixtime::now()), // date tl_string(), // public_service_announcement_type peerToTdbChat(history->session().userPeerId()), tl_int53(0)), // from_message_id + std::nullopt, // import_info std::nullopt, // interaction_info tl_vector(), // unread_reactions std::nullopt, // reply_to diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index cfa651e09ffd82..fdbfa3f20a9840 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -115,9 +115,9 @@ void ShareBotGame( const auto api = &history->session().api(); history->session().sender().request(TLsendMessage( peerToTdbChat(history->peer->id), - tl_int53(action.replyTo.topicRootId.bare), + MessageThreadId(history->peer, action), MessageReplyTo(action), - std::nullopt, // Options. + std::optional(), tl_inputMessageGame( peerToTdbChat(bot->id), tl_string(shortName))