mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 05:07:10 +02:00
Fixed display of message without text in section of shared links.
This commit is contained in:
parent
155305f0f7
commit
9a44ca2769
3 changed files with 17 additions and 0 deletions
|
@ -1726,6 +1726,10 @@ MediaWebPageFlags MediaWebPage::webpageFlags() const {
|
|||
return _flags;
|
||||
}
|
||||
|
||||
Storage::SharedMediaTypesMask MediaWebPage::sharedMediaTypes() const {
|
||||
return Storage::SharedMediaType::Link;
|
||||
}
|
||||
|
||||
bool MediaWebPage::hasReplyPreview() const {
|
||||
if (const auto document = MediaWebPage::document()) {
|
||||
return document->hasThumbnail()
|
||||
|
|
|
@ -446,6 +446,8 @@ public:
|
|||
WebPageData *webpage() const override;
|
||||
MediaWebPageFlags webpageFlags() const override;
|
||||
|
||||
Storage::SharedMediaTypesMask sharedMediaTypes() const override;
|
||||
|
||||
bool hasReplyPreview() const override;
|
||||
Image *replyPreview() const override;
|
||||
bool replyPreviewLoaded() const override;
|
||||
|
|
|
@ -1638,6 +1638,17 @@ Link::Link(
|
|||
}
|
||||
_links.push_back(LinkEntry(url, entityText));
|
||||
}
|
||||
if (_links.empty()) {
|
||||
if (const auto media = parent->media()) {
|
||||
if (const auto webpage = media->webpage()) {
|
||||
if (!webpage->displayUrl.isEmpty()
|
||||
&& !webpage->url.isEmpty()) {
|
||||
_links.push_back(
|
||||
LinkEntry(webpage->displayUrl, webpage->url));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (lnk > 0 && till > from) {
|
||||
--lnk;
|
||||
auto &entity = entities.at(lnk);
|
||||
|
|
Loading…
Add table
Reference in a new issue