From f8d900d7fbc4dfafb1b291981f59840bb076eda9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 8 Jun 2019 12:39:15 +0300 Subject: [PATCH] Fix freezes in support mode message edit. --- Telegram/SourceFiles/chat_helpers/message_field.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp index b89c8ec3a..c5bc917a4 100644 --- a/Telegram/SourceFiles/chat_helpers/message_field.cpp +++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp @@ -191,10 +191,11 @@ TextWithEntities StripSupportHashtag(TextWithEntities &&text) { auto &entity = *i; if (entity.offset() >= length) { i = text.entities.erase(i); + continue; } else if (entity.offset() + entity.length() > length) { entity.shrinkFromRight(length - entity.offset()); - ++i; } + ++i; } if (!text.text.isEmpty() && !text.text.endsWith('\n')) { text.text.append('\n');