forked from mystiq/hydrogen-web
also show reason for redaction
This commit is contained in:
parent
780ad44032
commit
b655c34bbb
2 changed files with 14 additions and 1 deletions
|
@ -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…
Reference in a new issue