diff options
author | George Hazan <george.hazan@gmail.com> | 2025-03-19 22:05:51 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-03-19 22:05:51 +0300 |
commit | 0be93f29ef172bc008e4b5787f3d01a39c06dad9 (patch) | |
tree | d9d11473da7d596060eaa9c5c2bb7395e139cac0 /protocols/Telegram/src/utils.cpp | |
parent | 3fe39e22a61394e523932cd9276305428b6bdf80 (diff) |
fixes #4907 completely
Diffstat (limited to 'protocols/Telegram/src/utils.cpp')
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<TD::formattedText> formatBbcodes(const char *pszText) case BBCODE::UNDERLINE: pNew = TD::make_object<TD::textEntityTypeUnderline>(); 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::textEntity>(TD::int32(i1), TD::int32(i2 - i1), std::move(pNew)));
}
|