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