Show an info message instead of an empty message for redactions
Fixes #26
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user