mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 12:37:22 +01:00
also show reason for redaction
This commit is contained in:
parent
780ad44032
commit
b655c34bbb
@ -22,6 +22,12 @@ export class RedactedTile extends BaseTextTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getBodyAsString() {
|
_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.`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,4 +116,11 @@ export class EventEntry extends BaseEntry {
|
|||||||
get isRedacted() {
|
get isRedacted() {
|
||||||
return !!this._eventEntry.event.unsigned?.redacted_because;
|
return !!this._eventEntry.event.unsigned?.redacted_because;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get redactionReason() {
|
||||||
|
const redactionEvent = this._eventEntry.event.unsigned?.redacted_because;
|
||||||
|
if (redactionEvent) {
|
||||||
|
return redactionEvent.content?.reason;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user