From b210e79f979d6ee2aa891af32781dd44785c127e Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 6 Dec 2023 12:57:49 +0300 Subject: [PATCH] Save link preview URL if size of the media is fixed or message text is empty. --- td/telegram/MessageContent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 84f91d12f..e3573df03 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -5683,10 +5683,10 @@ unique_ptr get_message_content(Td *td, FormattedText message, *disable_web_page_preview = (media->webpage_ == nullptr); } string web_page_url; - if (media->manual_) { + if (media->manual_ || media->force_small_media_ || media->force_large_media_ || message.text.empty()) { web_page_url = WebPagesManager::get_web_page_url(media->webpage_); if (web_page_url.empty()) { - LOG(ERROR) << "Have no URL in manual link preview"; + LOG(ERROR) << "Have no URL in " << to_string(media); } } auto web_page_id = td->web_pages_manager_->on_get_web_page(std::move(media->webpage_), owner_dialog_id);