mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: check time before appending
This commit is contained in:
parent
11abaac7c1
commit
39e3fcb553
1 changed files with 10 additions and 8 deletions
|
@ -1163,14 +1163,16 @@ void HistoryItem::setServiceText(PreparedServiceText &&prepared) {
|
||||||
auto text = std::move(prepared.text);
|
auto text = std::move(prepared.text);
|
||||||
|
|
||||||
const auto settings = &AyuSettings::getInstance();
|
const auto settings = &AyuSettings::getInstance();
|
||||||
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
if (date() > 0) {
|
||||||
base::unixtime::parse(_date),
|
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
||||||
settings->showMessageSeconds
|
base::unixtime::parse(_date),
|
||||||
? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
settings->showMessageSeconds
|
||||||
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
||||||
));
|
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
||||||
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
|
));
|
||||||
text = text.append(timeString);
|
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
|
||||||
|
text = text.append(timeString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddComponents(HistoryServiceData::Bit());
|
AddComponents(HistoryServiceData::Bit());
|
||||||
|
|
Loading…
Add table
Reference in a new issue