Read Marker Hidden

Only show the read marker if there is a non-hidden event earlier in the timeline

fixes network/neochat#615
This commit is contained in:
James Graham
2023-11-12 16:32:08 +00:00
parent d1dc6fc4ed
commit 2a3e1dfcd7

View File

@@ -437,6 +437,15 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
const KFormat format;
return format.formatRelativeDateTime(eventDate, QLocale::ShortFormat);
}
case SpecialMarksRole:
// Check if all the earlier events in the timeline are hidden. If so hide this.
for (auto r = row - 1; r >= 0; --r) {
const auto specialMark = index(r).data(SpecialMarksRole);
if (!(specialMark == EventStatus::Hidden || specialMark == EventStatus::Replaced)) {
return EventStatus::Normal;
}
}
return EventStatus::Hidden;
}
return {};
}