From beb062dd640efccdba5bc77368f8c87f71fd4a10 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 3 Dec 2022 13:51:14 +0300 Subject: [PATCH] Removed requesting of full peers from box of applying TTL for chats. Since TTL is provided from the dialog info. --- Telegram/SourceFiles/settings/settings_global_ttl.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_global_ttl.cpp b/Telegram/SourceFiles/settings/settings_global_ttl.cpp index acb1d46563..f3c070b790 100644 --- a/Telegram/SourceFiles/settings/settings_global_ttl.cpp +++ b/Telegram/SourceFiles/settings/settings_global_ttl.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/peer_list_controllers.h" #include "data/data_changes.h" #include "data/data_peer.h" +#include "data/data_session.h" #include "history/history.h" #include "lang/lang_keys.h" #include "lottie/lottie_icon.h" @@ -126,6 +127,9 @@ std::unique_ptr TTLChatsBoxController::createRow( } else if (!history->peer->canWrite()) { return nullptr; } + if (session().data().contactsNoChatsList()->contains({ history })) { + return nullptr; + } auto result = std::make_unique(history); const auto applyStatus = [=, raw = result.get()] { const auto ttl = history->peer->messagesTTL(); @@ -138,13 +142,6 @@ std::unique_ptr TTLChatsBoxController::createRow( : tr::lng_settings_ttl_select_chats_status_disabled(tr::now), ttl); }; - if (!history->peer->messagesTTL()) { - session().api().requestFullPeer(history->peer); - session().changes().peerUpdates( - history->peer, - Data::PeerUpdate::Flag::FullInfo - ) | rpl::take(1) | rpl::start_with_next(applyStatus, _lifetime); - } applyStatus(); return result; }