From 19a5dc8a0cfabeed50a71ee4c8b58a6ebc077336 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Tue, 12 Mar 2024 22:38:07 +0300 Subject: [PATCH] fix: hint stacking for TTL messages --- Telegram/SourceFiles/history/history_item.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 4e471faef9..1ccc07cf9a 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -2794,11 +2794,14 @@ void HistoryItem::setAyuHint(const QString &hint) { && this->author()->isMegagroup(); } else { const auto data = Get(); - auto prepared = PreparedServiceText{ - .text = _text.append(QString(" (%1)").arg(hint)), - .links = data->textLinks - }; - setServiceText(std::move(prepared)); + const auto postfix = QString(" (%1)").arg(hint); + if (!_text.text.endsWith(postfix)) { // fix stacking for TTL messages + auto prepared = PreparedServiceText{ + .text = _text.append(postfix), + .links = data->textLinks + }; + setServiceText(std::move(prepared)); + } } history()->owner().requestItemViewRefresh(this);