/* 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 "base/timer.h" namespace Main { class Session; } // namespace Main namespace Data { class DocumentMedia; class Session; class Forum; class ForumIcons final { public: explicit ForumIcons(not_null owner); ~ForumIcons(); [[nodiscard]] Session &owner() const { return *_owner; } [[nodiscard]] Main::Session &session() const; void refreshDefault(); void requestDefaultIfUnknown(); [[nodiscard]] const std::vector &list() const; [[nodiscard]] rpl::producer<> defaultUpdates() const; void scheduleUserpicsReset(not_null forum); void clearUserpicsReset(not_null forum); private: void requestDefault(); void resetUserpics(); void resetUserpicsFor(not_null forum); void updateDefault(const MTPDmessages_stickerSet &data); const not_null _owner; std::vector _default; rpl::event_stream<> _defaultUpdated; mtpRequestId _defaultRequestId = 0; base::flat_map, crl::time> _resetUserpicsWhen; base::Timer _resetUserpicsTimer; rpl::lifetime _lifetime; }; } // namespace Data