/* 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 "mtproto/sender.h" class ApiWrap; namespace Main { class Session; } // namespace Main namespace Api { class BlockedPeers final { public: struct Slice { struct Item { PeerId id; TimeId date = 0; bool operator==(const Item &other) const; bool operator!=(const Item &other) const; }; QVector list; int total = 0; bool operator==(const Slice &other) const; bool operator!=(const Slice &other) const; }; explicit BlockedPeers(not_null api); void reload(); rpl::producer slice(); void request(int offset, Fn onDone); void block(not_null peer); void unblock(not_null peer, Fn onDone = nullptr); private: const not_null _session; MTP::Sender _api; base::flat_map, mtpRequestId> _blockRequests; mtpRequestId _requestId = 0; std::optional _slice; rpl::event_stream _changes; }; } // namespace Api