diff --git a/src/domain/session/room/timeline/tiles/RedactedTile.js b/src/domain/session/room/timeline/tiles/RedactedTile.js index 9349f06e..bf1fc0db 100644 --- a/src/domain/session/room/timeline/tiles/RedactedTile.js +++ b/src/domain/session/room/timeline/tiles/RedactedTile.js @@ -22,6 +22,12 @@ export class RedactedTile extends BaseTextTile { } _getBodyAsString() { - return "This message has been deleted."; + const {redactionReason} = this._entry; + if (redactionReason) { + return this.i18n`This message has been deleted (${redactionReason}).`; + + } else { + return this.i18n`This message has been deleted.`; + } } } diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index 561c9f8e..2c30acfb 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -116,4 +116,11 @@ export class EventEntry extends BaseEntry { get isRedacted() { return !!this._eventEntry.event.unsigned?.redacted_because; } + + get redactionReason() { + const redactionEvent = this._eventEntry.event.unsigned?.redacted_because; + if (redactionEvent) { + return redactionEvent.content?.reason; + } + } } \ No newline at end of file