Add the redacter display name to the redaction text

pull/21833/head
Luke Barnard 2017-03-03 17:35:42 +00:00
parent 5ef61b7c35
commit 9bae936816
1 changed files with 8 additions and 3 deletions

View File

@ -17,14 +17,19 @@ limitations under the License.
'use strict'; 'use strict';
var React = require('react'); var React = require('react');
var MatrixClientPeg = require('../../../MatrixClientPeg');
module.exports = React.createClass({ module.exports = React.createClass({
displayName: 'UnknownBody', displayName: 'UnknownBody',
render: function() { render: function() {
var text = this.props.mxEvent.getContent().body; const ev = this.props.mxEvent;
if (this.props.mxEvent.isRedacted()) { var text = ev.getContent().body;
text = "This event was redacted"; if (ev.isRedacted()) {
const room = MatrixClientPeg.get().getRoom(ev.getRoomId());
const because = ev.getUnsigned().redacted_because;
const name = room.getMember(because.sender).name || because.sender;
text = "This event was redacted by " + name;
} }
return ( return (
<span className="mx_UnknownBody"> <span className="mx_UnknownBody">