Handle redaction with no sender

This commit is contained in:
Luke Barnard 2017-10-25 17:37:20 +01:00
parent 5990e41bd7
commit cedc0b27a9
2 changed files with 9 additions and 7 deletions

View file

@ -25,9 +25,10 @@ module.exports = React.createClass({
render: function() {
let tooltip = _t("Removed or unknown message type");
if (this.props.mxEvent.isRedacted()) {
tooltip = _t("Message removed by %(userId)s", {
userId: this.props.mxEvent.getUnsigned().redacted_because.sender,
});
const redactedBecauseUserId = this.props.mxEvent.getUnsigned().redacted_because.sender;
tooltip = redactedBecauseUserId ?
_t("Message removed by %(userId)s", { userId: redactedBecauseUserId }) :
_t("Message removed");
}
const text = this.props.mxEvent.getContent().body;