Don't show elapsed time for posts less than a minute old

This commit is contained in:
Christian Muehlhaeuser 2020-02-28 12:42:17 +01:00
parent 2c5d731cd4
commit 2e6b539d9e
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -192,6 +192,9 @@ func (m *MessageModel) data(index *core.QModelIndex, role int) *core.QVariant {
}
case CreatedAt:
{
if time.Since(p.CreatedAt) < time.Minute {
return core.NewQVariant1("just now")
}
return core.NewQVariant1(humanize.Time(p.CreatedAt))
}
case Actor: