Show an info message instead of an empty message for redactions

Fixes #26
This commit is contained in:
Tobias Fella
2020-11-22 15:07:45 +01:00
parent 820b63d493
commit e778c18913
2 changed files with 5 additions and 1 deletions

View File

@@ -287,6 +287,10 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
const auto &evt = isPending ? **pendingIt : **timelineIt;
if (role == Qt::DisplayRole) {
if (evt.isRedacted()) {
auto reason = evt.redactedBecause()->reason();
return (reason.isEmpty()) ? i18n("<i>[This message was deleted]</i>") : i18n("<i>[This message was deleted: %1]</i>").arg(evt.redactedBecause()->reason());
}
return m_currentRoom->eventToString(evt, Qt::RichText);
}