diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 6a60346e8..96a59b77b 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -425,6 +425,7 @@ class WebPagesManager::RichText { string content; vector texts; FileId document_file_id; + WebPageId web_page_id; template void store(T &storer) const { @@ -435,6 +436,9 @@ class WebPagesManager::RichText { if (type == Type::InlineImage) { storer.context()->td().get_actor_unsafe()->documents_manager_->store_document(document_file_id, storer); } + if (type == Type::Url) { + store(web_page_id, storer); + } } template @@ -449,6 +453,13 @@ class WebPagesManager::RichText { LOG(ERROR) << "Failed to load document from database"; *this = RichText(); } + } else { + document_file_id = FileId(); + } + if (type == Type::Url && parser.version() >= static_cast(Version::SupportInstantView2_0)) { + parse(web_page_id, parser); + } else { + web_page_id = WebPageId(); } } }; @@ -2498,6 +2509,7 @@ WebPagesManager::RichText WebPagesManager::get_rich_text(tl_object_ptrurl_); result.texts.push_back(get_rich_text(std::move(rich_text->text_), documents)); + result.web_page_id = WebPageId(rich_text->webpage_id_); break; } case telegram_api::textEmail::ID: {