diff --git a/src/components/views/messages/MessageActionBar.js b/src/components/views/messages/MessageActionBar.js index fa020612c4..3fe3f74a9d 100644 --- a/src/components/views/messages/MessageActionBar.js +++ b/src/components/views/messages/MessageActionBar.js @@ -87,15 +87,13 @@ export default class MessageActionBar extends React.PureComponent { this.onFocusChange(true); } - render() { + isContentActionable() { const { mxEvent } = this.props; const { status: eventStatus } = mxEvent; // status is SENT before remote-echo, null after const isSent = !eventStatus || eventStatus === EventStatus.SENT; - let replyButton; - if (isSent && mxEvent.getType() === 'm.room.message') { const content = mxEvent.getContent(); if ( @@ -103,13 +101,23 @@ export default class MessageActionBar extends React.PureComponent { content.msgtype !== 'm.bad.encrypted' && content.hasOwnProperty('body') ) { - replyButton = ; + return true; } } + return false; + } + + render() { + let replyButton; + + if (this.isContentActionable()) { + replyButton = ; + } + return