From 4f2b559126ec36f5f5af20a756637cda3453d2d1 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 27 Nov 2023 22:21:10 +0100 Subject: [PATCH] Show author name when previous message was deleted This will cause the name to show up more often than necessary, but that's better than not showing it at all, which leads to messages being attributed to the wrong person. The root cause here is a mismatch in event visibility between EventStatus::Hidden and filterAcceptsRow in MessageFilterModel, which will be fixed in a future patch. --- src/models/messageeventmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/messageeventmodel.cpp b/src/models/messageeventmodel.cpp index a12da1d93..851ca8d3a 100644 --- a/src/models/messageeventmodel.cpp +++ b/src/models/messageeventmodel.cpp @@ -609,7 +609,10 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const if (data(i, SpecialMarksRole) != EventStatus::Hidden && !itemData(i).empty()) { return data(i, AuthorRole) != data(idx, AuthorRole) || data(i, DelegateTypeRole) == DelegateType::State || data(i, TimeRole).toDateTime().msecsTo(data(idx, TimeRole).toDateTime()) > 600000 - || data(i, TimeRole).toDateTime().toLocalTime().date().day() != data(idx, TimeRole).toDateTime().toLocalTime().date().day(); + || data(i, TimeRole).toDateTime().toLocalTime().date().day() != data(idx, TimeRole).toDateTime().toLocalTime().date().day() + // FIXME: This should not be necessary; the proper fix is to calculate this role in MessageFilterModel with the knowledge about the filtered + // events. + || data(i, IsRedactedRole).toBool(); } }