mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +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);
|
||||
|
||||
const auto settings = &AyuSettings::getInstance();
|
||||
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
||||
base::unixtime::parse(_date),
|
||||
settings->showMessageSeconds
|
||||
? 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 (date() > 0) {
|
||||
const auto timeString = QString(" (%1)").arg(QLocale().toString(
|
||||
base::unixtime::parse(_date),
|
||||
settings->showMessageSeconds
|
||||
? QLocale::system().timeFormat(QLocale::LongFormat).remove(" t")
|
||||
: QLocale::system().timeFormat(QLocale::ShortFormat)
|
||||
));
|
||||
if (!text.text.isEmpty() && !text.text.contains(timeString)) {
|
||||
text = text.append(timeString);
|
||||
}
|
||||
}
|
||||
|
||||
AddComponents(HistoryServiceData::Bit());
|
||||
|
|
Loading…
Add table
Reference in a new issue