From 3e78bff8a141dea3720b199ff094ee67ea18a618 Mon Sep 17 00:00:00 2001 From: Srevin Saju Date: Sat, 29 May 2021 15:15:55 +0300 Subject: [PATCH] feat: show the username and avatar again on date-change when the clock hits 00:00 in the user's time zone, but in the case of a continuous discussion, it is likely that "Today" date-change marker would obstruct the conversation, and the username and avatar would be missing. --- src/messageeventmodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/messageeventmodel.cpp b/src/messageeventmodel.cpp index b486c85ad..34dd5a7eb 100644 --- a/src/messageeventmodel.cpp +++ b/src/messageeventmodel.cpp @@ -682,7 +682,8 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const auto i = index(r); if (data(i, SpecialMarksRole) != EventStatus::Hidden) { return data(i, AuthorRole) != data(idx, AuthorRole) || data(i, EventTypeRole) != data(idx, EventTypeRole) - || data(idx, TimeRole).toDateTime().msecsTo(data(i, TimeRole).toDateTime()) > 600000; + || data(idx, TimeRole).toDateTime().msecsTo(data(i, TimeRole).toDateTime()) > 600000 + || data(idx, TimeRole).toDateTime().toLocalTime().date().day() != data(i, TimeRole).toDateTime().toLocalTime().date().day(); } }