From c153a2474603756dc7dd26d7a8f9a71307a67032 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 11 Sep 2024 14:21:05 +0400 Subject: [PATCH] Fixed the build for 1.8.36. --- Telegram/SourceFiles/api/api_premium.cpp | 10 +++ Telegram/SourceFiles/api/api_premium.h | 1 + Telegram/SourceFiles/api/api_updates.cpp | 72 +++++++++++++------ Telegram/SourceFiles/apiwrap.cpp | 23 ++++++ .../SourceFiles/core/local_url_handlers.cpp | 38 ++++++++++ .../data/business/data_business_chatbots.cpp | 23 ++++-- .../SourceFiles/data/data_file_origin.cpp | 2 + Telegram/SourceFiles/data/data_file_origin.h | 2 + Telegram/SourceFiles/data/data_peer.cpp | 34 ++++++++- Telegram/SourceFiles/data/data_peer.h | 6 ++ .../SourceFiles/data/data_premium_limits.cpp | 3 + Telegram/SourceFiles/data/data_session.cpp | 17 +++++ .../history/history_inner_widget.cpp | 2 + Telegram/SourceFiles/history/history_item.cpp | 11 +++ .../history/history_item_helpers.cpp | 10 +++ .../view/history_view_contact_status.cpp | 2 + .../view/media/history_view_media_common.cpp | 2 + .../media/history_view_theme_document.cpp | 12 ++++ .../info/bot/earn/info_bot_earn_list.cpp | 20 ++++++ .../earn/info_channel_earn_list.cpp | 45 ++++++++++++ .../info/profile/info_profile_actions.cpp | 6 ++ .../settings/business/settings_chatbots.cpp | 14 ++++ .../business/settings_shortcut_messages.cpp | 4 ++ .../settings/settings_business.cpp | 15 ++++ .../settings/settings_credits_graphics.cpp | 3 + .../settings/settings_information.cpp | 2 + Telegram/SourceFiles/storage/file_upload.cpp | 4 ++ .../window/window_main_menu_helpers.cpp | 15 ++++ .../window/window_session_controller.cpp | 6 ++ 29 files changed, 378 insertions(+), 26 deletions(-) diff --git a/Telegram/SourceFiles/api/api_premium.cpp b/Telegram/SourceFiles/api/api_premium.cpp index a7ce80209f9571..7097389d78ea70 100644 --- a/Telegram/SourceFiles/api/api_premium.cpp +++ b/Telegram/SourceFiles/api/api_premium.cpp @@ -999,18 +999,28 @@ bool PremiumGiftCodeOptions::giveawayGiftsPurchaseAvailable() const { } SponsoredToggle::SponsoredToggle(not_null session) +#if 0 // mtp : _api(&session->api().instance()) { +#endif +: _session(session) +, _api(&session->sender()) { } rpl::producer SponsoredToggle::toggled() { return [=](auto consumer) { auto lifetime = rpl::lifetime(); + _api.request(TLgetUserFullInfo( + tl_int53(peerToUser(_session->userPeerId()).bare) + )).done([=](const TLDuserFullInfo &data) { + consumer.put_next_copy(data.vhas_sponsored_messages_enabled().v); +#if 0 // mtp _api.request(MTPusers_GetFullUser( MTP_inputUserSelf() )).done([=](const MTPusers_UserFull &result) { consumer.put_next_copy( result.data().vfull_user().data().is_sponsored_enabled()); +#endif }).fail([=] { consumer.put_next(false); }).send(); return lifetime; diff --git a/Telegram/SourceFiles/api/api_premium.h b/Telegram/SourceFiles/api/api_premium.h index c3555e31324b81..ee99d8018ec998 100644 --- a/Telegram/SourceFiles/api/api_premium.h +++ b/Telegram/SourceFiles/api/api_premium.h @@ -240,6 +240,7 @@ class SponsoredToggle final { [[nodiscard]] rpl::producer setToggled(bool); private: + const not_null _session; MTP::Sender _api; }; diff --git a/Telegram/SourceFiles/api/api_updates.cpp b/Telegram/SourceFiles/api/api_updates.cpp index d0f369db9cf1e5..0582ea2e489ae0 100644 --- a/Telegram/SourceFiles/api/api_updates.cpp +++ b/Telegram/SourceFiles/api/api_updates.cpp @@ -74,6 +74,7 @@ For license and copyright information please follow this link: #include "boxes/peers/add_participants_box.h" #include "window/notifications_manager.h" #include "data/components/factchecks.h" +#include "mainwidget.h" namespace Api { namespace { @@ -2881,6 +2882,10 @@ void Updates::applyUpdate(const TLupdate &update) { owner.applyLastMessage(data); }, [&](const TLDupdateChatPosition &data) { owner.applyDialogPosition(data); + }, [&](const TLDupdateChatAddedToList &data) { + // ?? can be in chat list and without position in that list + }, [&](const TLDupdateChatRemovedFromList &data) { + // ?? can be not in chat list and with a position in that list }, [&](const TLDupdateChatMessageSender &data) { const auto peerId = peerFromTdbChat(data.vchat_id()); if (const auto peer = owner.peerLoaded(peerId)) { @@ -2915,6 +2920,13 @@ void Updates::applyUpdate(const TLupdate &update) { if (const auto history = owner.historyLoaded(peerId)) { history->setUnreadMark(data.vis_marked_as_unread().v); } + }, [&](const TLDupdateChatViewAsTopics &data) { + const auto peerId = peerFromTdbChat(data.vchat_id()); + if (const auto peer = owner.peerLoaded(peerId)) { + if (const auto channel = peer->asChannel()) { + channel->setViewAsMessagesFlag(!data.vview_as_topics().v); + } + } }, [&](const TLDupdateChatBlockList &data) { const auto peerId = peerFromTdbChat(data.vchat_id()); if (const auto peer = session().data().peerLoaded(peerId)) { @@ -2986,6 +2998,8 @@ void Updates::applyUpdate(const TLupdate &update) { } }, [&](const TLDupdateActiveEmojiReactions &data) { owner.reactions().refreshActive(data); + }, [&](const TLDupdateAvailableMessageEffects &data) { + owner.reactions().refreshEffects(data); }, [&](const TLDupdateDefaultReactionType &data) { owner.reactions().refreshFavorite(data); }, [&](const TLDupdateChatNotificationSettings &data) { @@ -3005,6 +3019,7 @@ void Updates::applyUpdate(const TLupdate &update) { return Data::DefaultNotify::Broadcast; }); owner.notifySettings().apply(type, data.vnotification_settings()); + }, [&](const TLDupdateReactionNotificationSettings &data) { }, [&](const TLDupdateChatMessageAutoDeleteTime &data) { const auto peerId = peerFromTdbChat(data.vchat_id()); if (const auto peer = owner.peerLoaded(peerId)) { @@ -3015,6 +3030,11 @@ void Updates::applyUpdate(const TLupdate &update) { if (const auto peer = owner.peerLoaded(peerId)) { peer->setActionBar(data.vaction_bar()); } + }, [&](const TLDupdateChatBusinessBotManageBar &data) { + const auto peerId = peerFromTdbChat(data.vchat_id()); + if (const auto peer = owner.peerLoaded(peerId)) { + peer->updateBusinessBot(data.vbusiness_bot_manage_bar()); + } }, [&](const TLDupdateChatBackground &data) { const auto peerId = peerFromTdbChat(data.vchat_id()); if (const auto peer = owner.peerLoaded(peerId)) { @@ -3055,6 +3075,11 @@ void Updates::applyUpdate(const TLupdate &update) { history->applyPosition(position.data()); } } + }, [&](const TLDupdateChatEmojiStatus &data) { + const auto peerId = peerFromTdbChat(data.vchat_id()); + if (const auto peer = owner.peerLoaded(peerId)) { + peer->setEmojiStatus(data.vemoji_status()); + } }, [&](const TLDupdateChatFolders &data) { owner.chatsFilters().apply(data); }, [&](const TLDupdateChatOnlineMemberCount &data) { @@ -3168,11 +3193,12 @@ void Updates::applyUpdate(const TLupdate &update) { session().data().stickers().apply(data); }, [&](const TLDupdateSavedNotificationSounds &data) { session().api().ringtones().applyUpdate(); - }, [&](const TLDupdateSelectedBackground &data) { + }, [&](const TLDupdateDefaultBackground &data) { }, [&](const TLDupdateChatThemes &data) { session().data().cloudThemes().applyUpdate(data); }, [&](const TLDupdateAccentColors &data) { session().applyAccentColors(data); + }, [&](const TLDupdateProfileAccentColors &data) { }, [&](const TLDupdateLanguagePackStrings &data) { Lang::CurrentCloudManager().apply(data); }, [&](const TLDupdateTermsOfService &data) { @@ -3238,26 +3264,6 @@ void Updates::applyUpdate(const TLupdate &update) { }, [&](const TLDupdateFileAddedToDownloads &data) { }, [&](const TLDupdateFileDownload &data) { }, [&](const TLDupdateFileRemovedFromDownloads &data) { - }, [&](const TLDupdateAddChatMembersPrivacyForbidden &data) { - const auto peerId = peerFromTdbChat(data.vchat_id()); - if (const auto peer = owner.peerLoaded(peerId)) { - auto users = std::vector>(); - for (const auto &id : data.vuser_ids().v) { - if (const auto user = owner.userLoaded(UserId(id.v))) { - users.push_back(user); - } - } - if (const auto window = Core::App().windowFor(peer)) { - if (const auto controller = window->sessionController()) { - if (&controller->session() == &peer->session()) { - ChatInviteForbidden( - window->uiShow(), - peer, - std::move(users)); - } - } - } - } }, [&](const TLDupdateAutosaveSettings &data) { }, [&](const TLDupdateForumTopicInfo &data) { const auto peerId = peerFromTdbChat(data.vchat_id()); @@ -3267,6 +3273,21 @@ void Updates::applyUpdate(const TLupdate &update) { topic->applyInfo(data.vinfo()); } } + }, [&](const TLDupdateOwnedStarCount &data) { + session().setCredits(data.vstar_count().v); + }, [&](const TLDupdateSpeechRecognitionTrial &data) { + session().api().transcribes().apply(data); + }, [&](const TLDupdateSpeedLimitNotification &data) { + if (const auto window = Core::App().activeWindow()) { + if (const auto controller = window->sessionController()) { + if (&controller->session() == &session()) { + controller->content()->showNonPremiumLimitToast( + !data.vis_upload().v); + } + } + } + }, [&](const TLDupdateContactCloseBirthdays &data) { + }, [&](const TLDupdateStory &data) { owner.stories().apply(data); }, [&](const TLDupdateStoryDeleted &data) { @@ -3278,6 +3299,13 @@ void Updates::applyUpdate(const TLupdate &update) { }, [&](const TLDupdateStoryStealthMode &data) { owner.stories().apply(data); + }, [&](const TLDupdateSavedMessagesTags &data) { + owner.reactions().refreshMyTags(data); + }, [&](const TLDupdateSavedMessagesTopic &data) { + owner.savedMessages().apply(data); + }, [&](const TLDupdateSavedMessagesTopicCount &data) { + owner.savedMessages().apply(data); + }, [&](const TLDupdateQuickReplyShortcut &data) { owner.shortcutMessages().apply(data); }, [&](const TLDupdateQuickReplyShortcutDeleted &data) { @@ -3290,6 +3318,8 @@ void Updates::applyUpdate(const TLupdate &update) { // Updates below are handled in a different place. }, [&](const TLDupdateConnectionState &data) { }, [&](const TLDupdateServiceNotification &data) { + }, [&](const TLDupdateChatRevenueAmount &data) { + }, [&](const TLDupdateStarRevenueStatus &data) { // Updates below are not relevant. }, [&](const TLDupdateStorySendSucceeded &data) { diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index cd554d6dc88dfe..5431bc81b27c03 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3309,10 +3309,16 @@ void ApiWrap::setGroupEmojiSet( Expects(megagroup->mgInfo != nullptr); megagroup->mgInfo->emojiSet = set; + sender().request(TLsetSupergroupCustomEmojiStickerSet( + tl_int53(peerToChannel(megagroup->id).bare), + tl_int64(set.id) + )).send(); +#if 0 // mtp request(MTPchannels_SetEmojiStickers( megagroup->inputChannel, Data::InputStickerSet(set) )).send(); +#endif _session->changes().peerUpdated( megagroup, Data::PeerUpdate::Flag::EmojiSet); @@ -3995,11 +4001,17 @@ void ApiWrap::requestHistory( return; } + auto prepared = Api::PrepareHistoryRequest(peer, messageId, slice); +#if 0 // mtp const auto prepared = Api::PrepareHistoryRequest(peer, messageId, slice); auto &histories = history->owner().histories(); const auto requestType = Data::Histories::RequestType::History; histories.sendRequest(history, requestType, [=](Fn finish) { return request( +#endif + { + const auto finish = [] {}; + sender().request( std::move(prepared) ).done([=](const Api::HistoryRequestResult &result) { _historyRequests.remove(key); @@ -4017,7 +4029,10 @@ void ApiWrap::requestHistory( _historyRequests.remove(key); finish(); }).send(); + } +#if 0 // mtp }); +#endif _historyRequests.emplace(key); } @@ -4632,6 +4647,13 @@ void ApiWrap::cancelLocalItem(not_null item) { void ApiWrap::sendShortcutMessages( not_null peer, BusinessShortcutId id) { + sender().request(TLsendQuickReplyShortcutMessages( + peerToTdbChat(peer->id), + tl_int32(id), + tl_int32(0) // sending_id + )).fail([=](const Error &error) { + }).send(); +#if 0 // mtp auto ids = QVector(); auto randomIds = QVector(); request(MTPmessages_SendQuickReplyMessages( @@ -4643,6 +4665,7 @@ void ApiWrap::sendShortcutMessages( applyUpdates(result); }).fail([=](const MTP::Error &error) { }).send(); +#endif } void ApiWrap::sendMessage(MessageToSend &&message) { diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 52d98896fdd8bd..a7b106627f511f 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -104,7 +104,10 @@ PersonalChannelController::PersonalChannelController( PersonalChannelController::~PersonalChannelController() { if (_requestId) { +#if 0 // mtp _window->session().api().request(_requestId).cancel(); +#endif + _window->session().sender().request(_requestId).cancel(); } } @@ -118,6 +121,7 @@ void PersonalChannelController::prepare() { tr::lng_contacts_loading(), computeListSt().about)); +#if 0 // mtp using Flag = MTPchannels_GetAdminedPublicChannels::Flag; _requestId = _window->session().api().request( MTPchannels_GetAdminedPublicChannels( @@ -132,6 +136,16 @@ void PersonalChannelController::prepare() { const auto owner = &_window->session().data(); for (const auto &chat : chats) { if (const auto peer = owner->processChat(chat)) { +#endif + _requestId = _window->session().sender().request( + TLgetSuitablePersonalChats() + ).done([=](const TLchats &result) { + _requestId = 0; + + setDescription(nullptr); + const auto owner = &_window->session().data(); + for (const auto &chat : result.data().vchat_ids().v) { + if (const auto peer = owner->peerLoaded(peerFromTdbChat(chat))) { const auto rowId = peer->id.value; const auto channel = peer->asChannel(); if (channel && !delegate()->peerListFindRow(rowId)) { @@ -194,6 +208,7 @@ void SavePersonalChannel( || (messageId && self->personalChannelMessageId() != messageId)) { self->setPersonalChannel(channelId, messageId); +#if 0 // mtp self->session().api().request(MTPaccount_UpdatePersonalChannel( channel ? channel->inputChannel : MTP_inputChannelEmpty() )).done(crl::guard(window, [=] { @@ -203,6 +218,16 @@ void SavePersonalChannel( })).fail(crl::guard(window, [=](const MTP::Error &error) { window->showToast(u"Error: "_q + error.type()); })).send(); +#endif + self->session().sender().request(TLsetPersonalChat( + channel ? peerToTdbChat(channel->id) : tl_int53(0) + )).done(crl::guard(window, [=] { + window->showToast((channel + ? tr::lng_settings_channel_saved + : tr::lng_settings_channel_removed)(tr::now)); + })).fail(crl::guard(window, [=](const Error &error) { + window->showToast(error.message); + })).send(); } } @@ -819,6 +844,7 @@ bool ShowEditBirthday( const auto save = [=](Data::Birthday result) { user->setBirthday(result); +#if 0 // mtp using Flag = MTPaccount_UpdateBirthday::Flag; using BFlag = MTPDbirthday::Flag; user->session().api().request(MTPaccount_UpdateBirthday( @@ -836,6 +862,18 @@ bool ShowEditBirthday( ? tr::lng_flood_error(tr::now) : (u"Error: "_q + error.type())); })).handleFloodErrors().send(); +#endif + user->session().sender().request(TLsetBirthdate(result + ? tl_birthdate( + tl_int32(result.day()), + tl_int32(result.month()), + tl_int32(result.year())) + : std::optional() + )).done(crl::guard(controller, [=] { + controller->showToast(tr::lng_settings_birthday_saved(tr::now)); + })).fail(crl::guard(controller, [=](const Error &error) { + controller->showToast(error.message); + })).send(); }; controller->show(Box( Ui::EditBirthdayBox, diff --git a/Telegram/SourceFiles/data/business/data_business_chatbots.cpp b/Telegram/SourceFiles/data/business/data_business_chatbots.cpp index 891212ef5fe726..dc747b2ffdc17d 100644 --- a/Telegram/SourceFiles/data/business/data_business_chatbots.cpp +++ b/Telegram/SourceFiles/data/business/data_business_chatbots.cpp @@ -181,11 +181,16 @@ void Chatbots::togglePaused(not_null peer, bool paused) { api->request(i->second.requestId).cancel(); _sentRequests.erase(i); } -#if 0 // tdlib todo + const auto id = api->request(TLtoggleBusinessConnectedBotChatIsPaused( + peerToTdbChat(peer->id), + tl_bool(paused) + )).done([=] { +#if 0 // mtp const auto id = api->request(MTPaccount_ToggleConnectedBotPaused( peer->input, MTP_bool(paused) )).done([=] { +#endif if (_sentRequests[peer].type != type) { return; } else if (const auto settings = peer->barSettings()) { @@ -194,19 +199,22 @@ void Chatbots::togglePaused(not_null peer, bool paused) { & ~PeerBarSetting::BusinessBotCanReply) : ((*settings & ~PeerBarSetting::BusinessBotPaused) | PeerBarSetting::BusinessBotCanReply)); +#if 0 // mtp } else { api->requestPeerSettings(peer); +#endif } _sentRequests.remove(peer); }).fail([=] { if (_sentRequests[peer].type != type) { return; } +#if 0 // mtp api->requestPeerSettings(peer); +#endif _sentRequests.remove(peer); }).send(); _sentRequests[peer] = SentRequest{ type, id }; -#endif } void Chatbots::removeFrom(not_null peer) { @@ -224,25 +232,32 @@ void Chatbots::removeFrom(not_null peer) { api->request(i->second.requestId).cancel(); _sentRequests.erase(i); } -#if 0 // tdlib todo + const auto id = api->request(TLremoveBusinessConnectedBotFromChat( + peerToTdbChat(peer->id) + )).done([=] { +#if 0 // mtp const auto id = api->request(MTPaccount_DisablePeerConnectedBot( peer->input )).done([=] { +#endif if (_sentRequests[peer].type != type) { return; } else if (const auto settings = peer->barSettings()) { peer->clearBusinessBot(); +#if 0 // mtp } else { api->requestPeerSettings(peer); +#endif } _sentRequests.remove(peer); reload(); }).fail([=] { +#if 0 // mtp api->requestPeerSettings(peer); +#endif _sentRequests.remove(peer); }).send(); _sentRequests[peer] = SentRequest{ type, id }; -#endif } void Chatbots::reload() { diff --git a/Telegram/SourceFiles/data/data_file_origin.cpp b/Telegram/SourceFiles/data/data_file_origin.cpp index 76838edc37a2d7..f74b66ead4f897 100644 --- a/Telegram/SourceFiles/data/data_file_origin.cpp +++ b/Telegram/SourceFiles/data/data_file_origin.cpp @@ -7,6 +7,7 @@ For license and copyright information please follow this link: */ #include "data/data_file_origin.h" +#if 0 // mtp namespace Data { namespace { @@ -256,3 +257,4 @@ UpdatedFileReferences GetFileReferences(const MTPMessageMedia &data) { } } // namespace Data +#endif diff --git a/Telegram/SourceFiles/data/data_file_origin.h b/Telegram/SourceFiles/data/data_file_origin.h index 33e6a3f0d72bdd..61a9de6edc2a7c 100644 --- a/Telegram/SourceFiles/data/data_file_origin.h +++ b/Telegram/SourceFiles/data/data_file_origin.h @@ -205,6 +205,7 @@ struct UpdatedFileReferences { std::map data; }; +#if 0 // mtp UpdatedFileReferences GetFileReferences(const MTPmessages_Messages &data); UpdatedFileReferences GetFileReferences(const MTPphotos_Photos &data); UpdatedFileReferences GetFileReferences(const MTPusers_UserFull &data); @@ -224,5 +225,6 @@ UpdatedFileReferences GetFileReferences(const MTPstories_Stories &data); // Admin Log Event. UpdatedFileReferences GetFileReferences(const MTPMessageMedia &data); +#endif } // namespace Data diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 2ce15a5411b3be..9d36c3c2209cf9 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -775,6 +775,29 @@ void PeerData::checkFolder(FolderId folderId) { } #endif +void PeerData::updateBusinessBot(const TLbusinessBotManageBar *bar) { + if (!bar) { + clearBusinessBot(); + return; + } + const auto &data = bar->data(); + if (!_barDetails) { + _barDetails = std::make_unique(); + } + _barDetails->businessBot = _owner->user(data.vbot_user_id().v); + _barDetails->businessBotManageUrl = data.vmanage_url().v; + if (const auto settings = barSettings()) { + setBarSettings(*settings + | PeerBarSetting::HasBusinessBot + | (data.vis_bot_paused().v + ? PeerBarSetting::BusinessBotPaused + : PeerBarSetting(0)) + | (data.vcan_bot_reply().v + ? PeerBarSetting::BusinessBotCanReply + : PeerBarSetting(0))); + } +} + void PeerData::clearBusinessBot() { if (const auto details = _barDetails.get()) { if (details->requestChatDate) { @@ -950,7 +973,6 @@ bool PeerData::changeBackgroundEmojiId( ? cloudBackgroundEmoji->v : DocumentId()); } -#endif bool PeerData::changeColor( const tl::conditional &cloudColor) { @@ -962,6 +984,7 @@ bool PeerData::changeColor( : DocumentId()); return changed1 || changed2; } +#endif void PeerData::fillNames() { _nameWords.clear(); @@ -1290,6 +1313,12 @@ void PeerData::setEmojiStatus(const MTPEmojiStatus &status) { } #endif +void PeerData::setEmojiStatus(const TLemojiStatus *status) { + setEmojiStatus( + status ? status->data().vcustom_emoji_id().v : 0, + status ? status->data().vexpiration_date().v : 0); +} + void PeerData::setEmojiStatus(DocumentId emojiStatusId, TimeId until) { if (_emojiStatusId != emojiStatusId) { _emojiStatusId = emojiStatusId; @@ -1379,7 +1408,10 @@ bool PeerData::isRepliesChat() const { if (id != kTestId && id != kProductionId) { return false; } +#if 0 // mtp return ((session().mtp().environment() == MTP::Environment::Production) +#endif + return (!session().isTestMode() ? kProductionId : kTestId) == id; } diff --git a/Telegram/SourceFiles/data/data_peer.h b/Telegram/SourceFiles/data/data_peer.h index 58bcc07718fcad..7698c8f9fbfde3 100644 --- a/Telegram/SourceFiles/data/data_peer.h +++ b/Telegram/SourceFiles/data/data_peer.h @@ -41,6 +41,8 @@ class TLchatNotificationSettings; class TLchatActionBar; class TLfile; class TLchatAvailableReactions; +class TLbusinessBotManageBar; +class TLemojiStatus; } // namespace Tdb namespace Data { @@ -213,7 +215,10 @@ class PeerData { [[nodiscard]] DocumentId backgroundEmojiId() const; bool changeBackgroundEmojiId(DocumentId id); +#if 0 // mtp void setEmojiStatus(const MTPEmojiStatus &status); +#endif + void setEmojiStatus(const Tdb::TLemojiStatus *status); void setEmojiStatus(DocumentId emojiStatusId, TimeId until = 0); [[nodiscard]] DocumentId emojiStatusId() const; @@ -420,6 +425,7 @@ class PeerData { [[nodiscard]] UserData *businessBot() const; [[nodiscard]] QString businessBotManageUrl() const; void clearBusinessBot(); + void updateBusinessBot(const Tdb::TLbusinessBotManageBar *bar); enum class TranslationFlag : uchar { Unknown, diff --git a/Telegram/SourceFiles/data/data_premium_limits.cpp b/Telegram/SourceFiles/data/data_premium_limits.cpp index 98b91bd73696b9..717573907520a2 100644 --- a/Telegram/SourceFiles/data/data_premium_limits.cpp +++ b/Telegram/SourceFiles/data/data_premium_limits.cpp @@ -10,6 +10,9 @@ For license and copyright information please follow this link: #include "main/main_app_config.h" #include "main/main_session.h" +#include "main/main_account.h" +#include "tdb/tdb_options.h" + namespace Data { PremiumLimits::PremiumLimits(not_null session) diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 56f09b0f840e45..d5ec6e033eb685 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -4044,6 +4044,7 @@ not_null Session::venueIconDocument(const QString &icon) { if (i != end(_venueIcons)) { return i->second; } +#if 0 // mtp const auto result = documentFromWeb(MTP_webDocumentNoProxy( MTP_string(u"https://ss3.4sqi.net/img/categories_v2/"_q + icon @@ -4051,6 +4052,13 @@ not_null Session::venueIconDocument(const QString &icon) { MTP_int(0), MTP_string("image/png"), MTP_vector()), {}, {}); +#endif + const auto result = document(base::RandomValue()); + result->setMimeString(u"image/png"_q); + result->setContentUrl(u"https://ss3.4sqi.net/img/categories_v2/"_q + + icon + + u"_64.png"_q); + _venueIcons.emplace(icon, result); return result; } @@ -5637,12 +5645,21 @@ void Session::saveViewAsMessages( bool viewAsMessages) { const auto channel = forum->channel(); if (const auto requestId = _viewAsMessagesRequests.take(channel)) { +#if 0 // mtp _session->api().request(*requestId).cancel(); +#endif + _session->sender().request(*requestId).cancel(); } +#if 0 // mtp _viewAsMessagesRequests[channel] = _session->api().request( MTPchannels_ToggleViewForumAsMessages( channel->inputChannel, MTP_bool(viewAsMessages)) +#endif + _viewAsMessagesRequests[channel] = _session->sender().request( + TLtoggleChatViewAsTopics( + peerToTdbChat(channel->id), + tl_bool(!viewAsMessages)) ).done([=] { _viewAsMessagesRequests.remove(channel); }).fail([=] { diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 5fc759d1c28240..83eeca8b43e419 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2366,6 +2366,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } }; +#if 0 // mtp #ifdef _DEBUG // Sometimes we need to save emoji to files. if (const auto item = _dragStateItem) { const auto emojiStickers = &session->emojiStickersPack(); @@ -2378,6 +2379,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } } } +#endif #endif const auto asGroup = !Element::Moused() diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 0916849a219283..77cd4be202bc03 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -566,6 +566,13 @@ HistoryItem::HistoryItem( createComponents(std::move(config)); + if (const auto type = data.vself_destruct_type()) { + type->match([&](const TLDmessageSelfDestructTypeImmediately &) { + _flags |= MessageFlag::SelfDestructImmediate; + }, [](const TLDmessageSelfDestructTypeTimer &) { + }); + } + setContent(data.vcontent()); if (const auto groupId = data.vmedia_album_id().v) { if (replacing && replacing->groupId()) { @@ -2840,6 +2847,10 @@ const std::vector &HistoryItem::reactions() const { return _reactions ? _reactions->list() : kEmpty; } +bool HistoryItem::selfDestructImmediate() const { + return _flags & MessageFlag::SelfDestructImmediate; +} + bool HistoryItem::reactionsAreTags() const { return _flags & MessageFlag::ReactionsAreTags; } diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index 9ac858058cb81b..8cbd66768f739f 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -994,6 +994,12 @@ void ClearMediaAsExpired(not_null item) { return; } if (const auto document = media->document()) { + item->updateContent(document->isVoiceMessage() + ? tl_messageExpiredVoiceNote() + : document->isVideoMessage() + ? tl_messageExpiredVideoNote() + : tl_messageExpiredVideo()); +#if 0 // mtp item->applyEditionToHistoryCleared(); auto text = (document->isVideoFile() ? tr::lng_ttl_video_expired @@ -1003,11 +1009,15 @@ void ClearMediaAsExpired(not_null item) { ? tr::lng_ttl_round_expired : tr::lng_message_empty)(tr::now, Ui::Text::WithEntities); item->updateServiceText(PreparedServiceText{ std::move(text) }); +#endif } else if (const auto photo = media->photo()) { + item->updateContent(tl_messageExpiredPhoto()); +#if 0 // mtp item->applyEditionToHistoryCleared(); item->updateServiceText(PreparedServiceText{ tr::lng_ttl_photo_expired(tr::now, Ui::Text::WithEntities) }); +#endif } } } diff --git a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp index fe426efa376fda..4f651c47456ecd 100644 --- a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp +++ b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp @@ -1060,9 +1060,11 @@ auto BusinessBotStatus::PeerState(not_null peer) } void BusinessBotStatus::setupState(not_null peer) { +#if 0 // mtp if (!BarCurrentlyHidden(peer)) { peer->session().api().requestPeerSettings(peer); } +#endif PeerState( peer ) | rpl::start_with_next([=](State state) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp index 71b01fbf863e61..fd7dbd0d8aa92b 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_common.cpp @@ -235,7 +235,9 @@ ClickHandlerPtr MakePaidMediaLink(not_null item) { if (result != Result::Paid) { return; } else if (const auto item = session->data().message(itemId)) { +#if 0 // mtp session->api().views().pollExtendedMedia(item, true); +#endif if (const auto strong = weak.get()) { ShowPaidMediaUnlockedToast(strong, item); } diff --git a/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp b/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp index ef72e8f0858031..c393a7445b0323 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_theme_document.cpp @@ -38,9 +38,14 @@ For license and copyright information please follow this link: #include "window/themes/window_theme.h" #include "styles/style_chat.h" +#include "tdb/tdb_sender.h" +#include "tdb/tdb_tl_scheme.h" + namespace HistoryView { namespace { +using namespace Tdb; + [[nodiscard]] bool WallPaperRevertable( not_null peer, const Data::WallPaper &paper) { @@ -545,6 +550,7 @@ ClickHandlerPtr ThemeDocumentBox::createViewLink() { && !view->data()->out() && WallPaperRevertable(view->data())) { const auto reset = crl::guard(weak, [=](Fn close) { +#if 0 // mtp const auto api = &controller->session().api(); api->request(MTPmessages_SetChatWallPaper( MTP_flags(MTPmessages_SetChatWallPaper::Flag::f_revert), @@ -555,6 +561,12 @@ ClickHandlerPtr ThemeDocumentBox::createViewLink() { )).done([=](const MTPUpdates &result) { api->applyUpdates(result); }).send(); +#endif + controller->session().sender().request( + TLdeleteChatBackground( + peerToTdbChat(view->data()->history()->peer->id), + tl_bool(true)) + ).send(); close(); }); controller->show(Ui::MakeConfirmBox({ diff --git a/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp b/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp index cbe32faf5b6d74..3062b2ee3a4c46 100644 --- a/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp +++ b/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp @@ -42,9 +42,14 @@ For license and copyright information please follow this link: #include "styles/style_settings.h" #include "styles/style_statistics.h" +#include "tdb/tdb_account.h" +#include "tdb/tdb_tl_scheme.h" + namespace Info::BotEarn { namespace { +using namespace Tdb; + void AddHeader( not_null content, tr::phrase<> text) { @@ -97,6 +102,20 @@ void InnerWidget::load() { _loaded.fire(true); fill(); + _peer->session().tdb().updates( + ) | rpl::start_with_next([=](const TLupdate &update) { + update.match([&](const TLDupdateStarRevenueStatus &data) { + const auto peerId = peerFromSender(data.vowner_id()); + if (peerId == _peer->id) { + request([=](Data::CreditsEarnStatistics state) { + _state = state; + _stateUpdated.fire({}); + }); + } + }, [](const auto &) { + }); + }, lifetime()); +#if 0 // mtp _peer->session().account().mtpUpdates( ) | rpl::start_with_next([=](const MTPUpdates &updates) { using TL = MTPDupdateStarsRevenueStatus; @@ -110,6 +129,7 @@ void InnerWidget::load() { } }); }, lifetime()); +#endif }); }, lifetime()); } diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp index c96dac4eab840a..694088d29a46fc 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp @@ -66,9 +66,14 @@ For license and copyright information please follow this link: #include #include +#include "tdb/tdb_account.h" +#include "tdb/tdb_tl_scheme.h" + namespace Info::ChannelEarn { namespace { +using namespace Tdb; + using EarnInt = Data::EarnInt; [[nodiscard]] bool WithdrawalEnabled(not_null session) { @@ -299,6 +304,41 @@ void InnerWidget::load() { state->apiLifetime.destroy(); state->apiCreditsLifetime.destroy(); + const auto peerId = _peer->id; + _peer->session().tdb().updates( + ) | rpl::start_with_next([=](const TLupdate &update) { + update.match([&](const TLDupdateStarRevenueStatus &data) { + if (peerId != peerFromSender(data.vowner_id())) { + return; + } + const auto &status = data.vstatus().data(); + auto &e = _state.creditsEarn; + e.currentBalance = status.vcurrent_count().v; + e.availableBalance = status.vavailable_count().v; + e.overallRevenue = status.vtotal_count().v; + e.isWithdrawalEnabled = status.vwithdrawal_enabled().v; + e.nextWithdrawalAt = (status.vwithdrawal_enabled().v + ? QDateTime::currentDateTime().addSecs( + status.vnext_withdrawal_in().v) + : QDateTime()), + state->apiCreditsHistory.request({}, [=]( + const Data::CreditsStatusSlice &data) { + _state.creditsStatusSlice = data; + _stateUpdated.fire({}); + }); + }, [&](const TLDupdateChatRevenueAmount &data) { + if (peerId != peerFromTdbChat(data.vchat_id())) { + return; + } + const auto &amount = data.vrevenue_amount().data(); + auto &e = _state.currencyEarn; + e.currentBalance = amount.vbalance_amount().v; + e.availableBalance = amount.vavailable_amount().v; + e.overallRevenue = amount.vtotal_amount().v; + _stateUpdated.fire({}); + }, [](const auto &) {}); + }, lifetime()); +#if 0 // mtp _peer->session().account().mtpUpdates( ) | rpl::start_with_next([=, peerId = _peer->id]( const MTPUpdates &updates) { @@ -350,6 +390,7 @@ void InnerWidget::load() { } }); }, lifetime()); +#endif }; _showFinished.events( @@ -360,10 +401,12 @@ void InnerWidget::load() { state->apiCreditsHistory.request({}, [=]( const Data::CreditsStatusSlice &data) { _state.creditsStatusSlice = data; +#if 0 // mtp ::Api::PremiumPeerBot( &_peer->session() ) | rpl::start_with_next([=](not_null bot) { _state.premiumBotId = bot->id; +#endif state->apiCredits.request( ) | rpl::start_with_error_done([=](const QString &error) { if (canViewCredits) { @@ -376,8 +419,10 @@ void InnerWidget::load() { _state.creditsEarn = state->apiCredits.data(); finish(); }, state->apiCreditsLifetime); +#if 0 // mtp state->apiPremiumBotLifetime.destroy(); }, state->apiPremiumBotLifetime); +#endif }); }, state->apiLifetime); }, lifetime()); diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 3ffb63312c82b7..8613cca19f8a72 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -917,10 +917,16 @@ void ReportReactionBox( ChatRestrictionsInfo()); } } +#if 0 // mtp data.group->session().api().request(MTPmessages_ReportReaction( data.group->input, MTP_int(data.messageId.bare), participant->input +#endif + data.group->session().sender().request(TLreportMessageReactions( + peerToTdbChat(data.group->id), + tl_int53(data.messageId.bare), + peerToSender(participant->id) )).done(crl::guard(controller, [=] { controller->showToast(tr::lng_report_thanks(tr::now)); })).send(); diff --git a/Telegram/SourceFiles/settings/business/settings_chatbots.cpp b/Telegram/SourceFiles/settings/business/settings_chatbots.cpp index 3c75cf9baf8fdb..01114bea661e65 100644 --- a/Telegram/SourceFiles/settings/business/settings_chatbots.cpp +++ b/Telegram/SourceFiles/settings/business/settings_chatbots.cpp @@ -30,9 +30,14 @@ For license and copyright information please follow this link: #include "styles/style_layers.h" #include "styles/style_settings.h" +#include "tdb/tdb_tl_scheme.h" +#include "tdb/tdb_sender.h" + namespace Settings { namespace { +using namespace Tdb; + constexpr auto kDebounceTimeout = crl::time(400); enum class LookupState { @@ -272,6 +277,11 @@ Main::Session &PreviewController::session() const { auto result = rpl::lifetime(); const auto requestId = result.make_state(); + *requestId = session->sender().request(TLsearchPublicChat( + tl_string(extracted) + )).done([=](const TLchat &result) { + const auto peer = session->data().processPeer(result); +#if 0 // mtp *requestId = session->api().request(MTPcontacts_ResolveUsername( MTP_string(extracted) )).done([=](const MTPcontacts_ResolvedPeer &result) { @@ -280,6 +290,7 @@ Main::Session &PreviewController::session() const { session->data().processChats(data.vchats()); const auto peerId = peerFromMTP(data.vpeer()); const auto peer = session->data().peer(peerId); +#endif if (const auto user = peer->asUser()) { if (user->isBot()) { cache->emplace(extracted, user); @@ -298,7 +309,10 @@ Main::Session &PreviewController::session() const { }).send(); result.add([=] { +#if 0 // mtp session->api().request(*requestId).cancel(); +#endif + session->sender().request(*requestId).cancel(); }); return result; }; diff --git a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp index 5594e6c4c4a29c..7d5af3d144737d 100644 --- a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp +++ b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp @@ -1261,7 +1261,11 @@ void ShortcutMessages::edit( if (!*saveEditMsgRequestId) { return; } +#if 0 // mtp _session->api().request(base::take(*saveEditMsgRequestId)).cancel(); +#endif + _session->sender().request( + base::take(*saveEditMsgRequestId)).cancel(); }); const auto done = [=](mtpRequestId requestId) { diff --git a/Telegram/SourceFiles/settings/settings_business.cpp b/Telegram/SourceFiles/settings/settings_business.cpp index 66b707c5fcc144..3e3391db261733 100644 --- a/Telegram/SourceFiles/settings/settings_business.cpp +++ b/Telegram/SourceFiles/settings/settings_business.cpp @@ -396,7 +396,9 @@ void Business::setupContent() { const auto owner = &_controller->session().data(); owner->chatbots().preload(); owner->businessInfo().preload(); +#if 0 // mtp owner->shortcutMessages().preloadShortcuts(); +#endif owner->session().api().chatLinks().preload(); Ui::AddSkip(content, st::settingsFromFileTop); @@ -688,6 +690,16 @@ QPointer Business::createPinnedToBottom( auto buttonText = _buttonText.value(); + const auto weak = base::make_weak(_controller); + const auto startSubscription = [=] { + const auto value = _radioGroup->current(); + const auto options = session->api().premium().subscriptionOptions(); + if (value >= 0 && value < options.size()) { + options[value].startPayment(QVariant::fromValue( + ClickHandlerContext{ .sessionWindow = weak })); + } + }; + _subscribe = CreateSubscribeButton({ _controller, content, @@ -700,6 +712,9 @@ QPointer Business::createPinnedToBottom( ? options[value].botUrl : QString(); }, + nullptr, // show + false, // showPromo + startSubscription }); { const auto callback = [=](int value) { diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 1eaef456826c6f..09544c14ad455a 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -159,7 +159,10 @@ void AddViewMediaHandler( .flags = MessageFlag::HasFromId | MessageFlag::AdminLogEntry, .from = peerId, .date = base::unixtime::serialize(e.date), + }, TextWithEntities()); +#if 0 // mtp }, TextWithEntities(), MTP_messageMediaEmpty()); +#endif auto fake = std::vector>(); fake.reserve(e.extended.size()); for (const auto &item : e.extended) { diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index c8b41341231b5f..006e352af9c5e2 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -387,7 +387,9 @@ void SetupBirthday( { &st::menuIconGiftPremium }); const auto key = Api::UserPrivacy::Key::Birthday; +#if 0 // mtp session->api().userPrivacy().reload(key); +#endif auto isExactlyContacts = session->api().userPrivacy().value( key ) | rpl::map([=](const Api::UserPrivacy::Rule &value) { diff --git a/Telegram/SourceFiles/storage/file_upload.cpp b/Telegram/SourceFiles/storage/file_upload.cpp index 8911a5f542ea34..c8bf862c6bedf8 100644 --- a/Telegram/SourceFiles/storage/file_upload.cpp +++ b/Telegram/SourceFiles/storage/file_upload.cpp @@ -115,6 +115,7 @@ struct Uploader::Request { bool nonPremiumDelayed = false; }; +#if 0 // mtp Uploader::Entry::Entry( FullMsgId itemId, const std::shared_ptr &file) @@ -155,6 +156,7 @@ bool Uploader::Entry::setPartSize(int partSize) { docPartsCount = (docSize + docPartSize - 1) / docPartSize; return (docPartsCount <= kDocumentMaxPartsCountDefault); } +#endif Uploader::Uploader(not_null api) : _api(api) { @@ -793,6 +795,7 @@ void Uploader::unpause() { #endif } +#if 0 // mtp void Uploader::cancelRequests(FullMsgId itemId) { for (auto i = begin(_requests); i != end(_requests);) { if (i->second.itemId == itemId) { @@ -810,6 +813,7 @@ void Uploader::cancelRequests(FullMsgId itemId) { &Request::itemId ), end(_pendingFromRemovedDcIndices)); } +#endif void Uploader::cancelAllRequests() { #if 0 // mtp diff --git a/Telegram/SourceFiles/window/window_main_menu_helpers.cpp b/Telegram/SourceFiles/window/window_main_menu_helpers.cpp index 629b6cf16c818d..34616b55a0e98b 100644 --- a/Telegram/SourceFiles/window/window_main_menu_helpers.cpp +++ b/Telegram/SourceFiles/window/window_main_menu_helpers.cpp @@ -35,9 +35,14 @@ For license and copyright information please follow this link: #include "styles/style_menu_icons.h" #include "styles/style_window.h" +#include "tdb/tdb_sender.h" +#include "tdb/tdb_tl_scheme.h" + namespace Window { namespace { +using namespace Tdb; + class VersionLabel final : public Ui::FlatLabel , public Ui::AbstractTooltipShower { @@ -93,6 +98,15 @@ not_null AddMyChannelsBox( Fn)> done) { const auto api = box->lifetime().make_state( &session->mtp()); + api->request(TLsearchStickerSet( + tl_string(u"tg_placeholders_android"_q) + )).done([=](const TLstickerSet &result) { + const auto &v = result.data().vstickers().v; + if (v.size() > 1) { + done(session->data().processDocument(v[1])); + } + }).send(); +#if 0 // mtp api->request(MTPmessages_GetStickerSet( Data::InputStickerSet({ .shortName = u"tg_placeholders_android"_q, @@ -107,6 +121,7 @@ not_null AddMyChannelsBox( }, [](const MTPDmessages_stickerSetNotModified &) { }); }).send(); +#endif }; const auto addIcon = [=](not_null box) { const auto widget = box->addRow(object_ptr(box)); diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 395e5009a42fe8..cc571f9e6eeac2 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -1606,6 +1606,7 @@ SessionController::SessionController( })); }, _lifetime); +#if 0 // mtp session->downloader().nonPremiumDelays( ) | rpl::start_with_next([=](DocumentId id) { checkNonPremiumLimitToastDownload(id); @@ -1615,6 +1616,7 @@ SessionController::SessionController( ) | rpl::start_with_next([=](FullMsgId id) { checkNonPremiumLimitToastUpload(id); }, _lifetime); +#endif session->addWindow(this); @@ -1624,6 +1626,7 @@ SessionController::SessionController( }); } +#if 0 // mtp bool SessionController::skipNonPremiumLimitToast(bool download) const { if (session().premium()) { return true; @@ -1667,6 +1670,7 @@ void SessionController::checkNonPremiumLimitToastUpload(FullMsgId id) { session().saveSettingsDelayed(); } } +#endif void SessionController::suggestArchiveAndMute() { const auto weak = base::make_weak(this); @@ -1988,7 +1992,9 @@ void SessionController::setupPremiumToast() { }) | rpl::distinct_until_changed() | rpl::skip( 1 ) | rpl::filter([=](bool premium) { +#if 0 // mtp session().mtp().requestConfig(); +#endif return premium; }) | rpl::start_with_next([=] { MainWindowShow(this).showToast({