1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

Add the redacter display name to the redaction text

This commit is contained in:
Luke Barnard
2017-03-03 17:35:42 +00:00
parent 5ef61b7c35
commit 9bae936816

View File

@@ -17,14 +17,19 @@ limitations under the License.
'use strict';
var React = require('react');
var MatrixClientPeg = require('../../../MatrixClientPeg');
module.exports = React.createClass({
displayName: 'UnknownBody',
render: function() {
var text = this.props.mxEvent.getContent().body;
if (this.props.mxEvent.isRedacted()) {
text = "This event was redacted";
const ev = this.props.mxEvent;
var text = ev.getContent().body;
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 (
<span className="mx_UnknownBody">