/* 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 "mtproto/sender.h" namespace Window { class SessionController; } // namespace Window namespace Settings { class BlockedBoxController : public PeerListController , private base::Subscriber { public: explicit BlockedBoxController( not_null window); Main::Session &session() const override; void prepare() override; void rowClicked(not_null row) override; void rowActionClicked(not_null row) override; void loadMoreRows() override; static void BlockNewUser(not_null window); private: void receivedUsers(const QVector &result); void handleBlockedEvent(not_null user); bool appendRow(not_null user); bool prependRow(not_null user); std::unique_ptr createRow(not_null user) const; const not_null _window; MTP::Sender _api; int _offset = 0; mtpRequestId _loadRequestId = 0; bool _allLoaded = false; }; class PhoneNumberPrivacyController : public EditPrivacyController { public: using Option = EditPrivacyBox::Option; using Exception = EditPrivacyBox::Exception; Key key() override; MTPInputPrivacyKey apiKey() 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