Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
don't assume redaction has redacted_because (local echo doesn't)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwindels committed Jun 3, 2019
1 parent 1515f8d commit 0cb29e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/views/messages/UnknownBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ module.exports = React.createClass({
render: function() {
let tooltip = _t("Removed or unknown message type");
if (this.props.mxEvent.isRedacted()) {
const redactedBecauseUserId = this.props.mxEvent.getUnsigned().redacted_because.sender;
const unsigned = this.props.mxEvent.getUnsigned();
const redactedBecause = unsigned && unsigned.redacted_because;
const redactedBecauseUserId = redactedBecause && redactedBecause.sender;
tooltip = redactedBecauseUserId ?
_t("Message removed by %(userId)s", { userId: redactedBecauseUserId }) :
_t("Message removed");
Expand Down

0 comments on commit 0cb29e8

Please sign in to comment.