From afde9cf6b814bdd06f706cfa5cd83755ebed9dd5 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 4 Mar 2020 16:38:22 +0300 Subject: [PATCH] Add anchor to referenced texts. GitOrigin-RevId: 035ed463fc05184e8ff1df1dd9460cd894569c9c --- td/telegram/WebPageBlock.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index cab42a84..9e213002 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -158,14 +158,18 @@ class RichText { return make_tl_object( context->td_->documents_manager_->get_document_object(document_file_id), width, height); } - case RichText::Type::Anchor: + case RichText::Type::Anchor: { if (context->is_first_pass_) { context->anchors_.emplace(Slice(content), texts[0].empty() ? nullptr : &texts[0]); } if (texts[0].empty()) { return make_tl_object(content); } - return texts[0].get_rich_text_object(context); + auto result = make_tl_object(); + result->texts_.push_back(make_tl_object(content)); + result->texts_.push_back(texts[0].get_rich_text_object(context)); + return std::move(result); + } } UNREACHABLE(); return nullptr;