From 4f6f976e50e5d701f2027a24bbec3d6aa0e23078 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 16 Oct 2023 23:09:17 +0300 Subject: [PATCH] Log if expected web_page_url isn't found. --- td/telegram/DraftMessage.cpp | 3 +++ td/telegram/MessageContent.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/td/telegram/DraftMessage.cpp b/td/telegram/DraftMessage.cpp index 9e8f29784..76cf1cf90 100644 --- a/td/telegram/DraftMessage.cpp +++ b/td/telegram/DraftMessage.cpp @@ -203,6 +203,9 @@ DraftMessage::DraftMessage(Td *td, telegram_api::object_ptr(draft_message->media_); web_page_url = std::move(media->url_); + if (web_page_url.empty()) { + LOG(ERROR) << "Have no URL in a draft with manual link preview"; + } force_small_media = media->force_small_media_; force_large_media = media->force_large_media_; } diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 0da4e11d3..071f9c11b 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -5316,6 +5316,9 @@ unique_ptr get_message_content(Td *td, FormattedText message, string web_page_url; if (media->manual_) { web_page_url = WebPagesManager::get_web_page_url(media->webpage_); + if (web_page_url.empty()) { + LOG(ERROR) << "Have no URL in manual link preview"; + } } auto web_page_id = td->web_pages_manager_->on_get_web_page(std::move(media->webpage_), owner_dialog_id); return td::make_unique(std::move(message), web_page_id, media->force_small_media_,