/* 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 "boxes/peer_list_box.h" #include "boxes/edit_privacy_box.h" #include "history/view/history_view_element.h" #include "api/api_blocked_peers.h" namespace Window { class SessionController; } // namespace Window namespace Ui { class ChatStyle; } // namespace Ui namespace Settings { class BlockedBoxController : public PeerListController { public: explicit BlockedBoxController( not_null window); Main::Session &session() const override; void prepare() override; void rowClicked(not_null row) override; void rowRightActionClicked(not_null row) override; void loadMoreRows() override; static void BlockNewPeer(not_null window); private: void applySlice(const Api::BlockedPeers::Slice &slice); void handleBlockedEvent(not_null peer); bool appendRow(not_null peer); bool prependRow(not_null peer); std::unique_ptr createRow(not_null peer) const; const not_null _window; int _offset = 0; bool _allLoaded = false; base::has_weak_ptr _guard; }; class PhoneNumberPrivacyController : public EditPrivacyController { public: using Option = EditPrivacyBox::Option; using Exception = EditPrivacyBox::Exception; Key key() override; rpl::producer title() override; rpl::producer optionsTitleKey() override; rpl::producer warning() override; rpl::producer exceptionButtonTextKey( Exception exception) override; rpl::producer exceptionBoxTitle(Exception exception) override; rpl::producer exceptionsDescription() override; object_ptr setupMiddleWidget( not_null controller, not_null parent, rpl::producer