2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Short poll extended media.

This commit is contained in:
John Preston
2022-09-12 18:18:31 +04:00
parent 379736a7d1
commit 40bdcd7ebc
8 changed files with 146 additions and 3 deletions

View File

@@ -1611,7 +1611,7 @@ std::unique_ptr<HistoryView::Media> MediaInvoice::createView(
message,
realParent,
replacing);
} else if (!_invoice.extendedPreview.dimensions.isEmpty()) {
} else if (_invoice.extendedPreview) {
return std::make_unique<HistoryView::ExtendedPreview>(
message,
&_invoice);

View File

@@ -63,6 +63,13 @@ struct ExtendedPreview {
QByteArray inlineThumbnailBytes;
QSize dimensions;
TimeId videoDuration = -1;
[[nodiscard]] bool empty() const {
return dimensions.isEmpty();
}
explicit operator bool() const {
return !empty();
}
};
class Media;