fix: check time before appending

This commit is contained in:
AlexeyZavar 2024-04-19 02:46:28 +03:00
parent 11abaac7c1
commit 39e3fcb553

View file

@ -1163,6 +1163,7 @@ void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
auto text = std::move(prepared.text);
const auto settings = &AyuSettings::getInstance();
if (date() > 0) {
const auto timeString = QString(" (%1)").arg(QLocale().toString(
base::unixtime::parse(_date),
settings->showMessageSeconds
@ -1172,6 +1173,7 @@ void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
text = text.append(timeString);
}
}
AddComponents(HistoryServiceData::Bit());
_flags &= ~MessageFlag::HasTextLinks;