From 6d458154a9501039401f2603e5fb8a1e8ab250fe Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Jun 2019 17:41:47 +0200 Subject: [PATCH] support resending edit in context menu --- .../views/context_menus/MessageContextMenu.js | 15 +++++++++++++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 16 insertions(+) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 95bf59b470..8fc226c31a 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -90,6 +90,11 @@ module.exports = React.createClass({ this.closeMenu(); }, + onResendEditClick: function() { + Resend.resend(this.props.mxEvent.replacingEvent()); + this.closeMenu(); + }, + e2eInfoClicked: function() { this.props.e2eInfoCallback(); this.closeMenu(); @@ -220,6 +225,8 @@ module.exports = React.createClass({ render: function() { const mxEvent = this.props.mxEvent; const eventStatus = mxEvent.status; + const editEvent = mxEvent.replacingEvent(); + const editStatus = editEvent && editEvent.status; let resendButton; let redactButton; let cancelButton; @@ -242,6 +249,14 @@ module.exports = React.createClass({ ); } + if (editStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend edit') } +
+ ); + } + if (isSent && this.state.canRedact) { redactButton = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 769316cd3b..912648b0c9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1302,6 +1302,7 @@ "Unable to reject invite": "Unable to reject invite", "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", + "Resend edit": "Resend edit", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", "Pin Message": "Pin Message",