mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
support emotes in edit history
This commit is contained in:
parent
beb003b2d6
commit
0fe28cba43
1 changed files with 15 additions and 4 deletions
|
@ -40,12 +40,23 @@ export default class EditHistoryMessage extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const event = this.props.mxEvent;
|
||||
const timestamp = formatTime(new Date(event.getTs()), this.props.isTwelveHour);
|
||||
const content = event.event.content["m.new_content"] || event.event.content;
|
||||
const {mxEvent} = this.props;
|
||||
const content = mxEvent.event.content["m.new_content"] || mxEvent.event.content;
|
||||
const contentElements = HtmlUtils.bodyToHtml(content);
|
||||
let contentContainer;
|
||||
if (mxEvent.getContent().msgtype === "m.emote") {
|
||||
const name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
|
||||
contentContainer = (<p ref="content">*
|
||||
<span className="mx_MEmoteBody_sender">{ name }</span>
|
||||
{contentElements}
|
||||
</p>);
|
||||
} else {
|
||||
contentContainer = (<p ref="content">{contentElements}</p>);
|
||||
}
|
||||
const timestamp = formatTime(new Date(mxEvent.getTs()), this.props.isTwelveHour);
|
||||
return <li className="edit mx_EventTile_content">
|
||||
<span className="mx_MessageTimestamp">{timestamp}</span>
|
||||
<p ref="content">{HtmlUtils.bodyToHtml(content)}</p>
|
||||
{ contentContainer }
|
||||
</li>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue