diff options
| author | levlam <levlam@telegram.org> | 2024-04-23 19:43:12 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-04-23 19:43:12 +0300 |
| commit | 8e2713ca93fcf26c67b35688fe2deaaa414c6069 (patch) | |
| tree | 07bae50cf2a18e06b5db44b4c03c3c17240934ef /td/telegram/RepliedMessageInfo.cpp | |
| parent | e9beb424446b696a8853e76950086ba22ca48471 (diff) | |
Use get_formatted_text.
Diffstat (limited to 'td/telegram/RepliedMessageInfo.cpp')
| -rw-r--r-- | td/telegram/RepliedMessageInfo.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/td/telegram/RepliedMessageInfo.cpp b/td/telegram/RepliedMessageInfo.cpp index 52e111787..34347c518 100644 --- a/td/telegram/RepliedMessageInfo.cpp +++ b/td/telegram/RepliedMessageInfo.cpp @@ -117,18 +117,11 @@ RepliedMessageInfo::RepliedMessageInfo(Td *td, tl_object_ptr<telegram_api::messa } if ((!origin_.is_empty() || message_id_ != MessageId()) && !reply_header->quote_text_.empty()) { is_quote_manual_ = reply_header->quote_; - auto entities = - get_message_entities(td->user_manager_.get(), std::move(reply_header->quote_entities_), "RepliedMessageInfo"); - auto status = fix_formatted_text(reply_header->quote_text_, entities, true, true, true, true, false); - if (status.is_error()) { - if (!clean_input_string(reply_header->quote_text_)) { - reply_header->quote_text_.clear(); - } - entities.clear(); - } - quote_ = FormattedText{std::move(reply_header->quote_text_), std::move(entities)}; - quote_position_ = max(0, reply_header->quote_offset_); + quote_ = get_formatted_text(td->user_manager_.get(), std::move(reply_header->quote_text_), + std::move(reply_header->quote_entities_), true, true, true, true, false, + "RepliedMessageInfo"); remove_unallowed_quote_entities(quote_); + quote_position_ = max(0, reply_header->quote_offset_); } } |
