From d66d3ca4d2284c12dbc287a4a867b66c86849096 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Jun 2019 17:52:42 +0200 Subject: [PATCH] support resending redaction in context menu --- .../views/context_menus/MessageContextMenu.js | 17 +++++++++++++++-- src/i18n/strings/en_EN.json | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 8fc226c31a..2d4004e065 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -95,6 +95,11 @@ module.exports = React.createClass({ this.closeMenu(); }, + onResendRedactionClick: function() { + Resend.resend(this.props.mxEvent.localRedactionEvent()); + this.closeMenu(); + }, + e2eInfoClicked: function() { this.props.e2eInfoCallback(); this.closeMenu(); @@ -225,8 +230,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; + const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status; + const redactStatus = mxEvent.localRedactionEvent() && mxEvent.localRedactionEvent().status; let resendButton; let redactButton; let cancelButton; @@ -257,6 +262,14 @@ module.exports = React.createClass({ ); } + if (redactStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend removal') } +
+ ); + } + if (isSent && this.state.canRedact) { redactButton = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 912648b0c9..b68e72ed1e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1303,6 +1303,7 @@ "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", "Resend edit": "Resend edit", + "Resend removal": "Resend removal", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", "Pin Message": "Pin Message",