support resending redaction in context menu

This commit is contained in:
Bruno Windels 2019-06-27 17:52:42 +02:00
parent 6d458154a9
commit d66d3ca4d2
2 changed files with 16 additions and 2 deletions

View File

@ -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 = (
<div className="mx_MessageContextMenu_field" onClick={this.onResendRedactionClick}>
{ _t('Resend removal') }
</div>
);
}
if (isSent && this.state.canRedact) {
redactButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onRedactClick}>

View File

@ -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",