element-web/src/views/molecules/SenderProfile.js

24 lines
664 B
JavaScript
Raw Normal View History

var React = require('react');
var SenderProfileController = require("../../controllers/molecules/SenderProfile");
module.exports = React.createClass({
mixins: [SenderProfileController],
render: function() {
var mxEvent = this.props.mxEvent;
var name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
2015-06-16 16:29:13 +02:00
var msgtype = mxEvent.getContent().msgtype;
if (msgtype && msgtype == 'm.emote') {
name = ''; // emote message must include the name so don't duplicate it
}
return (
<span className="mx_SenderProfile">
{name}
</span>
);
},
});