/* 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 "ui/text/custom_emoji_instance.h" struct StickerSetIdentifier; namespace Main { class Session; } // namespace Main namespace Data { class Session; struct CustomEmojiId; class CustomEmojiLoader; class CustomEmojiManager final { public: CustomEmojiManager(not_null owner); ~CustomEmojiManager(); [[nodiscard]] std::unique_ptr create( const QString &data, Fn update); [[nodiscard]] Main::Session &session() const; [[nodiscard]] Session &owner() const; private: struct Set { int32 hash = 0; mtpRequestId requestId = 0; base::flat_set documents; base::flat_set waiting; }; void requestSetIfNeeded(const CustomEmojiId &id); const not_null _owner; base::flat_map>> _instances; base::flat_map _sets; base::flat_map< uint64, std::vector>> _loaders; }; void FillTestCustomEmoji( not_null session, TextWithEntities &text); } // namespace Data