From 57f82c3c9e855e6ae3a293fa24ee83145e9e958b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 10 Aug 2017 10:18:37 +0100 Subject: [PATCH] Quote using innerText codep matrix-org/matrix-react-sdk#1289 --- .../views/context_menus/MessageContextMenu.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 2064cede0..5646be49f 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -134,10 +134,9 @@ module.exports = React.createClass({ }, onQuoteClick: function() { - console.log(this.props.mxEvent); dis.dispatch({ action: 'quote', - event: this.props.mxEvent, + text: this.props.eventTileOps.getInnerText(), }); this.closeMenu(); }, @@ -153,6 +152,7 @@ module.exports = React.createClass({ let unhidePreviewButton; let permalinkButton; let externalURLButton; + let quoteButton; if (eventStatus === 'not_sent') { resendButton = ( @@ -221,11 +221,13 @@ module.exports = React.createClass({ ); - const quoteButton = ( -
- { _t('Quote') } -
- ); + if (this.props.eventTileOps && this.props.eventTileOps.getInnerText) { + quoteButton = ( +
+ { _t('Quote') } +
+ ); + } // Bridges can provide a 'external_url' to link back to the source. if( typeof(this.props.mxEvent.event.content.external_url) === "string") {