Log if link preview is disabled, but still present.

This commit is contained in:
levlam 2023-11-06 15:59:10 +03:00
parent d1202f84a3
commit e9bf274f33
2 changed files with 4 additions and 1 deletions

View File

@ -6330,6 +6330,9 @@ tl_object_ptr<td_api::MessageContent> get_message_content_object(const MessageCo
} }
if (web_page == nullptr && get_first_url(m->text).empty()) { if (web_page == nullptr && get_first_url(m->text).empty()) {
disable_web_page_preview = false; disable_web_page_preview = false;
} else if (disable_web_page_preview && web_page != nullptr) {
LOG(ERROR) << "Have " << m->web_page_id << " in a message with link preview disabled";
web_page = nullptr;
} }
td_api::object_ptr<td_api::linkPreviewOptions> link_preview_options; td_api::object_ptr<td_api::linkPreviewOptions> link_preview_options;
if (disable_web_page_preview || !m->web_page_url.empty() || m->force_small_media || m->force_large_media || if (disable_web_page_preview || !m->web_page_url.empty() || m->force_small_media || m->force_large_media ||

View File

@ -60,7 +60,7 @@ struct WebPageIdHash {
}; };
inline StringBuilder &operator<<(StringBuilder &string_builder, WebPageId web_page_id) { inline StringBuilder &operator<<(StringBuilder &string_builder, WebPageId web_page_id) {
return string_builder << "web page " << web_page_id.get(); return string_builder << "link preview " << web_page_id.get();
} }
} // namespace td } // namespace td