mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Short poll extended media.
This commit is contained in:
@@ -997,6 +997,9 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
}
|
||||
session().data().reactions().poll(item, now);
|
||||
if (item->hasExtendedMediaPreview()) {
|
||||
session().api().views().pollExtendedMedia(item);
|
||||
}
|
||||
_reactionsManager->recordCurrentReactionEffect(
|
||||
item->fullId(),
|
||||
QPoint(0, top));
|
||||
|
@@ -1169,6 +1169,15 @@ bool HistoryItem::isRegular() const {
|
||||
return isHistoryEntry() && !isLocal();
|
||||
}
|
||||
|
||||
bool HistoryItem::hasExtendedMediaPreview() const {
|
||||
if (const auto media = _media.get()) {
|
||||
if (const auto invoice = media->invoice()) {
|
||||
return (invoice->extendedPreview && !invoice->extendedMedia);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void HistoryItem::sendFailed() {
|
||||
Expects(_flags & MessageFlag::BeingSent);
|
||||
Expects(!(_flags & MessageFlag::SendingFailed));
|
||||
|
@@ -239,6 +239,7 @@ public:
|
||||
[[nodiscard]] virtual bool externalReply() const {
|
||||
return false;
|
||||
}
|
||||
[[nodiscard]] bool hasExtendedMediaPreview() const;
|
||||
|
||||
[[nodiscard]] virtual MsgId repliesInboxReadTill() const {
|
||||
return MsgId(0);
|
||||
|
@@ -917,7 +917,7 @@ void HistoryMessageReplyMarkup::updateData(
|
||||
bool HistoryMessageReplyMarkup::hiddenBy(Data::Media *media) const {
|
||||
if (media && (data.flags & ReplyMarkupFlag::OnlyBuyButton)) {
|
||||
if (const auto invoice = media->invoice()) {
|
||||
if (!invoice->extendedPreview.dimensions.isEmpty()
|
||||
if (invoice->extendedPreview
|
||||
&& (!invoice->extendedMedia || !invoice->receiptMsgId)) {
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user