mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
return _flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Storage::SharedMediaTypesMask MediaWebPage::sharedMediaTypes() const {
|
||||||
|
return Storage::SharedMediaType::Link;
|
||||||
|
}
|
||||||
|
|
||||||
bool MediaWebPage::hasReplyPreview() const {
|
bool MediaWebPage::hasReplyPreview() const {
|
||||||
if (const auto document = MediaWebPage::document()) {
|
if (const auto document = MediaWebPage::document()) {
|
||||||
return document->hasThumbnail()
|
return document->hasThumbnail()
|
||||||
|
|
|
@ -446,6 +446,8 @@ public:
|
||||||
WebPageData *webpage() const override;
|
WebPageData *webpage() const override;
|
||||||
MediaWebPageFlags webpageFlags() const override;
|
MediaWebPageFlags webpageFlags() const override;
|
||||||
|
|
||||||
|
Storage::SharedMediaTypesMask sharedMediaTypes() const override;
|
||||||
|
|
||||||
bool hasReplyPreview() const override;
|
bool hasReplyPreview() const override;
|
||||||
Image *replyPreview() const override;
|
Image *replyPreview() const override;
|
||||||
bool replyPreviewLoaded() const override;
|
bool replyPreviewLoaded() const override;
|
||||||
|
|
|
@ -1638,6 +1638,17 @@ Link::Link(
|
||||||
}
|
}
|
||||||
_links.push_back(LinkEntry(url, entityText));
|
_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) {
|
while (lnk > 0 && till > from) {
|
||||||
--lnk;
|
--lnk;
|
||||||
auto &entity = entities.at(lnk);
|
auto &entity = entities.at(lnk);
|
||||||
|
|
Loading…
Add table
Reference in a new issue