From 0be93f29ef172bc008e4b5787f3d01a39c06dad9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 19 Mar 2025 22:05:51 +0300 Subject: fixes #4907 completely --- protocols/Telegram/src/utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'protocols/Telegram/src/utils.cpp') diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 3c3b68ebb1..c52a044c90 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -75,9 +75,12 @@ TD::object_ptr formatBbcodes(const char *pszText) case BBCODE::UNDERLINE: pNew = TD::make_object(); break; } - for (auto &jt : res->entities_) + for (auto &jt : res->entities_) { if (i1 >= jt->offset_ && i1 < jt->offset_ + jt->length_) jt->length_ -= it.len1; + if (i2 >= jt->offset_ && i2 < jt->offset_ + jt->length_) + jt->length_ -= it.len2; + } res->entities_.push_back(TD::make_object(TD::int32(i1), TD::int32(i2 - i1), std::move(pNew))); } -- cgit v1.2.3