From e8bf5bb5cec25b67f853467b3c8aaecdfdf8ea72 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 24 Mar 2020 12:58:47 +0400 Subject: [PATCH] Move manage filters to a Settings section. --- Telegram/CMakeLists.txt | 4 +- .../boxes/filters/manage_filters_box.h | 49 ---- .../SourceFiles/data/data_chat_filters.cpp | 50 ++++ Telegram/SourceFiles/data/data_chat_filters.h | 16 ++ Telegram/SourceFiles/info/info_top_bar.cpp | 2 + .../info/settings/info_settings_widget.cpp | 19 +- .../info/settings/info_settings_widget.h | 3 - .../SourceFiles/settings/settings_common.cpp | 3 + .../settings_folders.cpp} | 214 ++++++++---------- .../SourceFiles/settings/settings_folders.h | 29 +++ .../SourceFiles/settings/settings_main.cpp | 19 +- .../window/window_filters_menu.cpp | 15 +- .../SourceFiles/window/window_filters_menu.h | 4 +- .../window/window_session_controller.cpp | 2 - 14 files changed, 238 insertions(+), 191 deletions(-) delete mode 100644 Telegram/SourceFiles/boxes/filters/manage_filters_box.h rename Telegram/SourceFiles/{boxes/filters/manage_filters_box.cpp => settings/settings_folders.cpp} (78%) create mode 100644 Telegram/SourceFiles/settings/settings_folders.h diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 674627575..5c50088c8 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -153,8 +153,6 @@ PRIVATE boxes/filters/edit_filter_box.h boxes/filters/edit_filter_chats_list.cpp boxes/filters/edit_filter_chats_list.h - boxes/filters/manage_filters_box.cpp - boxes/filters/manage_filters_box.h boxes/peers/add_participants_box.cpp boxes/peers/add_participants_box.h boxes/peers/edit_contact_box.cpp @@ -842,6 +840,8 @@ PRIVATE settings/settings_codes.h settings/settings_common.cpp settings/settings_common.h + settings/settings_folders.cpp + settings/settings_folders.h settings/settings_information.cpp settings/settings_information.h settings/settings_intro.cpp diff --git a/Telegram/SourceFiles/boxes/filters/manage_filters_box.h b/Telegram/SourceFiles/boxes/filters/manage_filters_box.h deleted file mode 100644 index 955ecf311..000000000 --- a/Telegram/SourceFiles/boxes/filters/manage_filters_box.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ -#pragma once - -#include "data/data_chat_filters.h" - -class ApiWrap; - -namespace Ui { -class GenericBox; -} // namespace Ui - -namespace Window { -class SessionController; -} // namespace Window - -class ManageFiltersPrepare final { -public: - explicit ManageFiltersPrepare( - not_null window); - ~ManageFiltersPrepare(); - - void showBox(); - -private: - struct Suggested { - Data::ChatFilter filter; - QString description; - }; - - void showBoxWithSuggested(); - static void SetupBox( - not_null box, - not_null window, - const std::vector &suggested); - - const not_null _window; - const not_null _api; - - mtpRequestId _requestId = 0; - std::vector _suggested; - crl::time _suggestedLastReceived = 0; - -}; diff --git a/Telegram/SourceFiles/data/data_chat_filters.cpp b/Telegram/SourceFiles/data/data_chat_filters.cpp index 1058f68ec..c1f3618b0 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.cpp +++ b/Telegram/SourceFiles/data/data_chat_filters.cpp @@ -19,6 +19,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "apiwrap.h" namespace Data { +namespace { + +constexpr auto kRefreshSuggestedTimeout = 7200 * crl::time(1000); + +} // namespace ChatFilter::ChatFilter( FilterId id, @@ -500,5 +505,50 @@ auto ChatFilters::refreshHistoryRequests() const return _refreshHistoryRequests.events(); } +void ChatFilters::requestSuggested() { + if (_suggestedRequestId) { + return; + } + if (_suggestedLastReceived > 0 + && crl::now() - _suggestedLastReceived < kRefreshSuggestedTimeout) { + return; + } + const auto api = &_owner->session().api(); + _suggestedRequestId = api->request(MTPmessages_GetSuggestedDialogFilters( + )).done([=](const MTPVector &data) { + _suggestedRequestId = 0; + _suggestedLastReceived = crl::now(); + + _suggested = ranges::view::all( + data.v + ) | ranges::view::transform([&](const MTPDialogFilterSuggested &f) { + return f.match([&](const MTPDdialogFilterSuggested &data) { + return SuggestedFilter{ + Data::ChatFilter::FromTL(data.vfilter(), _owner), + qs(data.vdescription()) + }; + }); + }) | ranges::to_vector; + + _suggestedUpdated.fire({}); + }).fail([=](const RPCError &error) { + _suggestedRequestId = 0; + _suggestedLastReceived = crl::now() + kRefreshSuggestedTimeout / 2; + + _suggestedUpdated.fire({}); + }).send(); +} + +bool ChatFilters::suggestedLoaded() const { + return (_suggestedLastReceived > 0); +} + +const std::vector &ChatFilters::suggestedFilters() const { + return _suggested; +} + +rpl::producer<> ChatFilters::suggestedUpdated() const { + return _suggestedUpdated.events(); +} } // namespace Data diff --git a/Telegram/SourceFiles/data/data_chat_filters.h b/Telegram/SourceFiles/data/data_chat_filters.h index c6e15d7f1..71905f0f9 100644 --- a/Telegram/SourceFiles/data/data_chat_filters.h +++ b/Telegram/SourceFiles/data/data_chat_filters.h @@ -85,6 +85,11 @@ inline bool operator!=(const ChatFilter &a, const ChatFilter &b) { return !(a == b); } +struct SuggestedFilter { + ChatFilter filter; + QString description; +}; + class ChatFilters final { public: explicit ChatFilters(not_null owner); @@ -112,6 +117,12 @@ public: [[nodiscard]] bool archiveNeeded() const; + void requestSuggested(); + [[nodiscard]] bool suggestedLoaded() const; + [[nodiscard]] auto suggestedFilters() const + -> const std::vector &; + [[nodiscard]] rpl::producer<> suggestedUpdated() const; + private: void load(bool force); bool applyOrder(const QVector &order); @@ -130,6 +141,11 @@ private: mtpRequestId _saveOrderAfterId = 0; bool _loaded = false; + mtpRequestId _suggestedRequestId = 0; + std::vector _suggested; + rpl::event_stream<> _suggestedUpdated; + crl::time _suggestedLastReceived = 0; + }; } // namespace Data diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index dae0245cb..c3af7f734 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -624,6 +624,8 @@ rpl::producer TitleValue( return tr::lng_settings_advanced(); case Section::SettingsType::Chat: return tr::lng_settings_section_chat_settings(); + case Section::SettingsType::Folders: + return tr::lng_filters_title(); case Section::SettingsType::Calls: return tr::lng_settings_section_call_settings(); } diff --git a/Telegram/SourceFiles/info/settings/info_settings_widget.cpp b/Telegram/SourceFiles/info/settings/info_settings_widget.cpp index 76df4330f..553a2345d 100644 --- a/Telegram/SourceFiles/info/settings/info_settings_widget.cpp +++ b/Telegram/SourceFiles/info/settings/info_settings_widget.cpp @@ -10,7 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/info_memento.h" #include "info/info_controller.h" #include "settings/settings_common.h" -#include "boxes/filters/manage_filters_box.h" #include "ui/ui_utility.h" namespace Info { @@ -44,20 +43,14 @@ Widget::Widget( : ContentWidget(parent, controller) , _self(controller->key().settingsSelf()) , _type(controller->section().settingsType()) -, _inner(setInnerWidget(::Settings::CreateSection( - _type, - this, - controller->parentController()))) -, _manageFilters( - std::make_unique( - controller->parentController())) { +, _inner(setInnerWidget( + ::Settings::CreateSection( + _type, + this, + controller->parentController()))) { _inner->sectionShowOther( ) | rpl::start_with_next([=](Type type) { - if (type == Type::Folders) { - _manageFilters->showBox(); - } else { - controller->showSettings(type); - } + controller->showSettings(type); }, _inner->lifetime()); controller->setCanSaveChanges(_inner->sectionCanSaveChanges()); diff --git a/Telegram/SourceFiles/info/settings/info_settings_widget.h b/Telegram/SourceFiles/info/settings/info_settings_widget.h index 30c636d26..d5be88734 100644 --- a/Telegram/SourceFiles/info/settings/info_settings_widget.h +++ b/Telegram/SourceFiles/info/settings/info_settings_widget.h @@ -10,8 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/info_content_widget.h" #include "info/info_controller.h" -class ManageFiltersPrepare; - namespace Settings { class Section; } // namespace Settings @@ -80,7 +78,6 @@ private: Type _type = Type(); not_null<::Settings::Section*> _inner; - std::unique_ptr _manageFilters; }; diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index 6f7476fc2..688ac1868 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "settings/settings_main.h" #include "settings/settings_notifications.h" #include "settings/settings_privacy_security.h" +#include "settings/settings_folders.h" #include "settings/settings_calls.h" #include "ui/wrap/padding_wrap.h" #include "ui/wrap/vertical_layout.h" @@ -46,6 +47,8 @@ object_ptr
CreateSection( return object_ptr(parent, controller); case Type::Advanced: return object_ptr(parent, controller); + case Type::Folders: + return object_ptr(parent, controller); case Type::Chat: return object_ptr(parent, controller); case Type::Calls: diff --git a/Telegram/SourceFiles/boxes/filters/manage_filters_box.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp similarity index 78% rename from Telegram/SourceFiles/boxes/filters/manage_filters_box.cpp rename to Telegram/SourceFiles/settings/settings_folders.cpp index 102976472..66e001378 100644 --- a/Telegram/SourceFiles/boxes/filters/manage_filters_box.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -5,12 +5,13 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "boxes/filters/manage_filters_box.h" +#include "settings/settings_folders.h" #include "boxes/filters/edit_filter_box.h" #include "data/data_session.h" #include "data/data_folder.h" #include "data/data_peer.h" +#include "data/data_chat_filters.h" #include "history/history.h" #include "main/main_session.h" #include "window/window_session_controller.h" @@ -25,19 +26,19 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "settings/settings_common.h" #include "lang/lang_keys.h" #include "apiwrap.h" +#include "app.h" #include "styles/style_settings.h" #include "styles/style_layers.h" #include "styles/style_boxes.h" #include "styles/style_chat_helpers.h" #include "styles/style_window.h" +namespace Settings { namespace { constexpr auto kRefreshSuggestedTimeout = 7200 * crl::time(1000); constexpr auto kFiltersLimit = 10; -using namespace Settings; - using Flag = Data::ChatFilter::Flag; using Flags = Data::ChatFilter::Flags; @@ -92,6 +93,13 @@ private: }; +struct FilterRow { + not_null button; + Data::ChatFilter filter; + bool removed = false; + bool added = false; +}; + [[nodiscard]] int CountFilterChats( not_null session, const Data::ChatFilter &filter) { @@ -274,78 +282,17 @@ void FilterRowButton::paintEvent(QPaintEvent *e) { _status); } -} // namespace +[[nodiscard]] Fn SetupFoldersContent( + not_null controller, + not_null container) { + auto &lifetime = container->lifetime(); -ManageFiltersPrepare::ManageFiltersPrepare( - not_null window) -: _window(window) -, _api(&_window->session().api()) { -} + const auto session = &controller->session(); + AddSkip(container, st::settingsSectionSkip); + AddSubsectionTitle(container, tr::lng_filters_subtitle()); -ManageFiltersPrepare::~ManageFiltersPrepare() { - if (_requestId) { - _api->request(_requestId).cancel(); - } -} - -void ManageFiltersPrepare::showBox() { - if (_requestId) { - return; - } - if (_suggestedLastReceived > 0 - && crl::now() - _suggestedLastReceived < kRefreshSuggestedTimeout) { - showBoxWithSuggested(); - return; - } - _requestId = _api->request(MTPmessages_GetSuggestedDialogFilters( - )).done([=](const MTPVector &data) { - _requestId = 0; - _suggestedLastReceived = crl::now(); - - const auto owner = &_api->session().data(); - _suggested = ranges::view::all( - data.v - ) | ranges::view::transform([&](const MTPDialogFilterSuggested &f) { - return f.match([&](const MTPDdialogFilterSuggested &data) { - return Suggested{ - Data::ChatFilter::FromTL(data.vfilter(), owner), - qs(data.vdescription()) - }; - }); - }) | ranges::to_vector; - - showBoxWithSuggested(); - }).fail([=](const RPCError &error) { - _requestId = 0; - _suggestedLastReceived = crl::now() + kRefreshSuggestedTimeout / 2; - - showBoxWithSuggested(); - }).send(); -} - -void ManageFiltersPrepare::showBoxWithSuggested() { - _window->window().show(Box(SetupBox, _window, _suggested)); -} - -void ManageFiltersPrepare::SetupBox( - not_null box, - not_null window, - const std::vector &suggestions) { - box->setTitle(tr::lng_filters_title()); - - struct FilterRow { - not_null button; - Data::ChatFilter filter; - bool removed = false; - bool added = false; - }; - - const auto session = &window->session(); - const auto content = box->verticalLayout(); - AddSubsectionTitle(content, tr::lng_filters_subtitle()); - - const auto rows = box->lifetime().make_state>(); - const auto rowsCount = box->lifetime().make_state>(); + const auto rows = lifetime.make_state>(); + const auto rowsCount = lifetime.make_state>(); const auto find = [=](not_null button) { const auto i = ranges::find(*rows, button, &FilterRow::button); Assert(i != end(*rows)); @@ -356,10 +303,10 @@ void ManageFiltersPrepare::SetupBox( if (rows->size() < kFiltersLimit + removed) { return false; } - window->window().showToast(tr::lng_filters_limit(tr::now)); + controller->window().showToast(tr::lng_filters_limit(tr::now)); return true; }; - const auto wrap = content->add(object_ptr(content)); + const auto wrap = container->add(object_ptr(container)); const auto addFilter = [=](const Data::ChatFilter &filter) { const auto button = wrap->add( object_ptr(wrap, session, filter)); @@ -385,16 +332,16 @@ void ManageFiltersPrepare::SetupBox( find(button)->filter = result; button->updateData(result); }; - window->window().show(Box( + controller->window().show(Box( EditFilterBox, - window, + controller, found->filter, crl::guard(button, doneCallback))); }); rows->push_back({ button, filter }); *rowsCount = rows->size(); - wrap->resizeToWidth(content->width()); + wrap->resizeToWidth(container->width()); }; const auto &list = session->data().chatsFilters().list(); for (const auto &filter : list) { @@ -402,7 +349,7 @@ void ManageFiltersPrepare::SetupBox( } AddButton( - content, + container, tr::lng_filters_create() | Ui::Text::ToUpper(), st::settingsUpdate )->setClickedCallback([=] { @@ -412,54 +359,69 @@ void ManageFiltersPrepare::SetupBox( const auto doneCallback = [=](const Data::ChatFilter &result) { addFilter(result); }; - window->window().show(Box( + controller->window().show(Box( EditFilterBox, - window, + controller, Data::ChatFilter(), - crl::guard(box, doneCallback))); + crl::guard(container, doneCallback))); }); - AddSkip(content); - const auto emptyAbout = content->add( + AddSkip(container); + const auto emptyAbout = container->add( object_ptr>( - content, + container, object_ptr( - content, + container, tr::lng_filters_about(), st::boxDividerLabel), st::settingsDividerLabelPadding) )->setDuration(0); - const auto nonEmptyAbout = content->add( + const auto nonEmptyAbout = container->add( object_ptr>( - content, - object_ptr(content)) + container, + object_ptr(container)) )->setDuration(0); const auto aboutRows = nonEmptyAbout->entity(); AddDividerText(aboutRows, tr::lng_filters_about()); AddSkip(aboutRows); AddSubsectionTitle(aboutRows, tr::lng_filters_recommended()); - const auto changed = box->lifetime().make_state(); - const auto suggested = box->lifetime().make_state>(); - for (const auto &suggestion : suggestions) { - const auto &filter = suggestion.filter; - if (ranges::contains(list, filter)) { - continue; - } - *suggested = suggested->current() + 1; - const auto button = aboutRows->add(object_ptr( - aboutRows, - filter, - suggestion.description)); - button->addRequests( - ) | rpl::start_with_next([=] { - if (showLimitReached()) { - return; + const auto changed = lifetime.make_state(); + const auto suggested = lifetime.make_state>(); + rpl::single( + rpl::empty_value() + ) | rpl::then( + session->data().chatsFilters().suggestedUpdated() + ) | rpl::map([=] { + return session->data().chatsFilters().suggestedFilters(); + }) | rpl::filter([=](const std::vector &list) { + return !list.empty(); + }) | rpl::take( + 1 + ) | rpl::start_with_next([=]( + const std::vector &suggestions) { + for (const auto &suggestion : suggestions) { + const auto &filter = suggestion.filter; + if (ranges::contains(*rows, filter, &FilterRow::filter)) { + continue; } - addFilter(filter); - *suggested = suggested->current() - 1; - delete button; - }, button->lifetime()); - } + *suggested = suggested->current() + 1; + const auto button = aboutRows->add(object_ptr( + aboutRows, + filter, + suggestion.description)); + button->addRequests( + ) | rpl::start_with_next([=] { + if (showLimitReached()) { + return; + } + addFilter(filter); + *suggested = suggested->current() - 1; + delete button; + }, button->lifetime()); + } + aboutRows->resizeToWidth(container->width()); + AddSkip(aboutRows, st::settingsSectionSkip); + }, aboutRows->lifetime()); using namespace rpl::mappers; auto showSuggestions = rpl::combine( @@ -494,7 +456,7 @@ void ManageFiltersPrepare::SetupBox( return result; }; - const auto save = [=] { + return [=] { auto ids = prepareGoodIdsForNewFilters(); using Requests = std::vector; @@ -546,8 +508,32 @@ void ManageFiltersPrepare::SetupBox( if (!order.empty() && !addRequests.empty()) { realFilters.saveOrder(order, previousId); } - box->closeBox(); }; - box->boxClosing() | rpl::start_with_next(save, box->lifetime()); - box->addButton(tr::lng_about_done(), [=] { box->closeBox(); }); } + +} // namespace + +Folders::Folders( + QWidget *parent, + not_null controller) +: Section(parent) { + setupContent(controller); +} + +Folders::~Folders() { + if (!App::quitting()) { + _save(); + } +} + +void Folders::setupContent(not_null controller) { + controller->session().data().chatsFilters().requestSuggested(); + + const auto content = Ui::CreateChild(this); + + _save = SetupFoldersContent(controller, content); + + Ui::ResizeFitChild(this, content); +} + +} // namespace Settings diff --git a/Telegram/SourceFiles/settings/settings_folders.h b/Telegram/SourceFiles/settings/settings_folders.h new file mode 100644 index 000000000..63089cf5f --- /dev/null +++ b/Telegram/SourceFiles/settings/settings_folders.h @@ -0,0 +1,29 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "settings/settings_common.h" + +namespace Settings { + +class Folders : public Section { +public: + Folders( + QWidget *parent, + not_null controller); + ~Folders(); + +private: + void setupContent(not_null controller); + + Fn _save; + +}; + +} // namespace Settings + diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 990d1fde3..bc6f4293e 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -106,6 +106,9 @@ void SetupSections( Type::Chat, &st::settingsIconChat); + const auto preload = [=] { + controller->session().data().chatsFilters().requestSuggested(); + }; const auto account = &controller->session().account(); const auto slided = container->add( object_ptr>( @@ -118,18 +121,30 @@ void SetupSections( if (!controller->session().data().chatsFilters().list().empty() || Global::DialogsFiltersEnabled()) { slided->show(anim::type::instant); + preload(); } else { const auto enabled = [=] { - return account->appConfig().get( + const auto result = account->appConfig().get( "dialog_filters_enabled", false); + if (result) { + preload(); + } + return result; + }; + const auto preloadIfEnabled = [=](bool enabled) { + if (enabled) { + preload(); + } }; slided->toggleOn( rpl::single( rpl::empty_value() ) | rpl::then( account->appConfig().refreshed() - ) | rpl::map(enabled)); + ) | rpl::map( + enabled + ) | rpl::before_next(preloadIfEnabled)); } slided->entity()->setClickedCallback([=] { showOther(Type::Folders); diff --git a/Telegram/SourceFiles/window/window_filters_menu.cpp b/Telegram/SourceFiles/window/window_filters_menu.cpp index e035c1b4a..bfea04711 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.cpp +++ b/Telegram/SourceFiles/window/window_filters_menu.cpp @@ -13,10 +13,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_session.h" #include "data/data_session.h" #include "data/data_chat_filters.h" -#include "boxes/filters/manage_filters_box.h" #include "lang/lang_keys.h" #include "ui/filter_icons.h" #include "ui/wrap/vertical_layout_reorder.h" +#include "settings/settings_common.h" #include "api/api_chat_filters.h" #include "styles/style_widgets.h" #include "styles/style_window.h" @@ -28,7 +28,6 @@ FiltersMenu::FiltersMenu( not_null session) : _session(session) , _parent(parent) -, _manage(std::make_unique(_session)) , _outer(_parent) , _menu(&_outer, QString(), st::windowFiltersMainMenu) , _scroll(&_outer) @@ -191,7 +190,17 @@ base::unique_qptr FiltersMenu::prepareButton( } else if (id >= 0) { _session->setActiveChatsFilter(id); } else { - _manage->showBox(); + const auto filters = &_session->session().data().chatsFilters(); + if (filters->suggestedLoaded()) { + _session->showSettings(Settings::Type::Folders); + } else if (!_waitingSuggested) { + _waitingSuggested = true; + filters->requestSuggested(); + filters->suggestedUpdated( + ) | rpl::take(1) | rpl::start_with_next([=] { + _session->showSettings(Settings::Type::Folders); + }, _outer.lifetime()); + } } }); return button; diff --git a/Telegram/SourceFiles/window/window_filters_menu.h b/Telegram/SourceFiles/window/window_filters_menu.h index eceb23ff0..e5dbef669 100644 --- a/Telegram/SourceFiles/window/window_filters_menu.h +++ b/Telegram/SourceFiles/window/window_filters_menu.h @@ -11,8 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/scroll_area.h" #include "ui/wrap/vertical_layout.h" -class ManageFiltersPrepare; - namespace Ui { class VerticalLayoutReorder; enum class FilterIcon : uchar; @@ -45,7 +43,6 @@ private: const not_null _session; const not_null _parent; - std::unique_ptr _manage; Ui::RpWidget _outer; Ui::SideBarButton _menu; Ui::ScrollArea _scroll; @@ -58,6 +55,7 @@ private: FilterId _activeFilterId = 0; int _reordering = 0; bool _ignoreRefresh = false; + bool _waitingSuggested = false; }; diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index b1f207821..086618247 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -91,8 +91,6 @@ void SessionNavigation::showPeerInfo( void SessionNavigation::showSettings( Settings::Type type, const SectionShow ¶ms) { - Expects(type != Settings::Type::Folders); - showSection( Info::Memento( Info::Settings::Tag{ _session->user() },