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();
} else {
const auto data = Get<HistoryServiceData>();
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);