From d133c4fab7447552d785f379177fd75f8ce1c2dc Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 26 Aug 2022 19:00:02 +0000 Subject: [PATCH] Improve showAuthor behaviour 2 changes to showAuthor role; the first removes the same eventRole condition as currently a video or image followed by text will both show the avatar, second is to fix it so that the avatar is actually shown if messages are 10 mins apart as this is currently broken. --- src/messageeventmodel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/messageeventmodel.cpp b/src/messageeventmodel.cpp index 215d45f45..4883f744a 100644 --- a/src/messageeventmodel.cpp +++ b/src/messageeventmodel.cpp @@ -715,9 +715,8 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const for (auto r = row + 1; r < rowCount(); ++r) { 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().toLocalTime().date().day() != data(i, TimeRole).toDateTime().toLocalTime().date().day(); + return data(i, AuthorRole) != data(idx, AuthorRole) || data(i, TimeRole).toDateTime().msecsTo(data(idx, TimeRole).toDateTime()) > 600000 + || data(i, TimeRole).toDateTime().toLocalTime().date().day() != data(idx, TimeRole).toDateTime().toLocalTime().date().day(); } }