fix: hint stacking for TTL messages

This commit is contained in:
AlexeyZavar 2024-03-12 22:38:07 +03:00
parent 69e9841bbb
commit 19a5dc8a0c

View file

@ -2794,12 +2794,15 @@ void HistoryItem::setAyuHint(const QString &hint) {
&& this->author()->isMegagroup(); && this->author()->isMegagroup();
} else { } else {
const auto data = Get<HistoryServiceData>(); const auto data = Get<HistoryServiceData>();
const auto postfix = QString(" (%1)").arg(hint);
if (!_text.text.endsWith(postfix)) { // fix stacking for TTL messages
auto prepared = PreparedServiceText{ auto prepared = PreparedServiceText{
.text = _text.append(QString(" (%1)").arg(hint)), .text = _text.append(postfix),
.links = data->textLinks .links = data->textLinks
}; };
setServiceText(std::move(prepared)); setServiceText(std::move(prepared));
} }
}
history()->owner().requestItemViewRefresh(this); history()->owner().requestItemViewRefresh(this);
history()->owner().requestItemResize(this); history()->owner().requestItemResize(this);