2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Show nice thumbnails for paid albums.

This commit is contained in:
John Preston
2024-06-24 14:48:47 +04:00
parent dfc422b505
commit 90dfae52f5
7 changed files with 187 additions and 88 deletions

View File

@@ -156,11 +156,18 @@ struct PaidMediaData {
not_null<Payments::CreditsFormData*> form,
int photoSize) {
if (const auto data = LookupPaidMediaData(session, form)) {
const auto first = data.invoice->extendedMedia.front().get();
if (const auto photo = first->photo()) {
if (photo->extendedMediaPreview()) {
return Settings::PaidMediaPhoto(parent, photo, photoSize);
}
const auto first = data.invoice->extendedMedia[0]->photo();
const auto second = (data.photos > 1)
? data.invoice->extendedMedia[1]->photo()
: nullptr;
const auto totalCount = int(data.invoice->extendedMedia.size());
if (first && first->extendedMediaPreview()) {
return Settings::PaidMediaThumbnail(
parent,
first,
second,
totalCount,
photoSize);
}
}
if (form->photo) {