Files
tdesktop/Telegram/SourceFiles/data/data_reply_preview.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

51 lines
1.1 KiB
C++

/*
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
class Image;
class DocumentData;
class PhotoData;
namespace Data {
class PhotoMedia;
class DocumentMedia;
struct FileOrigin;
class ReplyPreview {
public:
explicit ReplyPreview(not_null<DocumentData*> document);
explicit ReplyPreview(not_null<PhotoData*> photo);
~ReplyPreview();
[[nodiscard]] Image *image(
Data::FileOrigin origin,
not_null<PeerData*> context,
bool spoiler);
[[nodiscard]] bool loaded(bool spoiler) const;
private:
void prepare(
not_null<Image*> image,
Images::Options options,
bool spoiler = false);
std::unique_ptr<Image> _regular;
std::unique_ptr<Image> _spoilered;
PhotoData *_photo = nullptr;
DocumentData *_document = nullptr;
std::shared_ptr<PhotoMedia> _photoMedia;
std::shared_ptr<DocumentMedia> _documentMedia;
bool _good = false;
bool _checkedRegular = false;
bool _checkedSpoilered = false;
};
} // namespace Data