mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Hide image preview of ttl rounds behind spoiler.
This commit is contained in:
parent
eb4ef8b3d7
commit
7123a6d647
1 changed files with 4 additions and 2 deletions
|
@ -1101,7 +1101,9 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const {
|
||||||
auto images = std::vector<ItemPreviewImage>();
|
auto images = std::vector<ItemPreviewImage>();
|
||||||
auto context = std::any();
|
auto context = std::any();
|
||||||
const auto existing = options.existing;
|
const auto existing = options.existing;
|
||||||
if (auto found = FindCachedPreview(existing, _document, _spoiler)) {
|
const auto spoilered = _spoiler
|
||||||
|
|| (_document->isVideoMessage() && ttlSeconds());
|
||||||
|
if (auto found = FindCachedPreview(existing, _document, spoilered)) {
|
||||||
images.push_back(std::move(found));
|
images.push_back(std::move(found));
|
||||||
} else if (TryFilePreview(_document)) {
|
} else if (TryFilePreview(_document)) {
|
||||||
const auto media = _document->createMediaView();
|
const auto media = _document->createMediaView();
|
||||||
|
@ -1112,7 +1114,7 @@ ItemPreview MediaFile::toPreview(ToPreviewOptions options) const {
|
||||||
parent(),
|
parent(),
|
||||||
media,
|
media,
|
||||||
radius,
|
radius,
|
||||||
_spoiler)
|
spoilered)
|
||||||
; prepared || !prepared.cacheKey) {
|
; prepared || !prepared.cacheKey) {
|
||||||
images.push_back(std::move(prepared));
|
images.push_back(std::move(prepared));
|
||||||
if (!prepared.cacheKey) {
|
if (!prepared.cacheKey) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue