/* 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 "data/data_abstract_sparse_ids.h" #include "storage/storage_user_photos.h" #include "base/weak_ptr.h" class UserData; namespace Main { class Session; } // namespace Main class UserPhotosSlice final : public AbstractSparseIds> { public: using Key = Storage::UserPhotosKey; UserPhotosSlice(Key key); UserPhotosSlice( Key key, std::deque &&ids, std::optional fullCount, std::optional skippedBefore, std::optional skippedAfter); std::optional distance(const Key &a, const Key &b) const; const Key &key() const { return _key; } private: Key _key; friend class UserPhotosSliceBuilder; }; rpl::producer UserPhotosViewer( not_null session, UserPhotosSlice::Key key, int limitBefore, int limitAfter); rpl::producer UserPhotosReversedViewer( not_null session, UserPhotosSlice::Key key, int limitBefore, int limitAfter); [[nodiscard]] std::optional SyncUserFallbackPhotoViewer( not_null user);