mirror of https://github.com/vector-im/riot-web
parent
a5830c229e
commit
3e35cffae7
|
@ -28,8 +28,9 @@ const RedactedBody = React.forwardRef<any, IProps>(({mxEvent}, ref) => {
|
|||
const cli: MatrixClient = useContext(MatrixClientContext);
|
||||
|
||||
let text = _t("Message deleted");
|
||||
const redactedBecauseUserId = mxEvent.getUnsigned().redacted_because.sender;
|
||||
if (redactedBecauseUserId && redactedBecauseUserId !== cli.getUserId()) {
|
||||
const unsigned = mxEvent.getUnsigned();
|
||||
const redactedBecauseUserId = unsigned && unsigned.redacted_because && unsigned.redacted_because.sender;
|
||||
if (redactedBecauseUserId && redactedBecauseUserId !== mxEvent.getSender()) {
|
||||
const room = cli.getRoom(mxEvent.getRoomId());
|
||||
const sender = room && room.getMember(redactedBecauseUserId);
|
||||
text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId });
|
||||
|
|
Loading…
Reference in New Issue