From 1af1297afcf9de0a6fd400a761d88002f5387a48 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 7 Dec 2015 11:38:34 +0000 Subject: [PATCH] Allow queued events to be cancelled. Make not sent events appear differently to sending events. --- .../views/rooms/MessageContextMenu.js | 21 +++++++++++++++++-- src/skins/vector/css/molecules/EventTile.css | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MessageContextMenu.js b/src/components/views/rooms/MessageContextMenu.js index c6100db2d3..87e02c7a61 100644 --- a/src/components/views/rooms/MessageContextMenu.js +++ b/src/components/views/rooms/MessageContextMenu.js @@ -57,25 +57,41 @@ module.exports = React.createClass({ if (this.props.onFinished) this.props.onFinished(); }, + onCancelSendClick: function() { + Resend.removeFromQueue(this.props.mxEvent); + }, + render: function() { + var eventStatus = this.props.mxEvent.status; var resendButton; var viewSourceButton; var redactButton; + var cancelButton; - if (this.props.mxEvent.status == 'not_sent') { + if (eventStatus === 'not_sent') { resendButton = (
Resend
); } - else { + + if (!eventStatus) { // sent redactButton = (
Redact
); } + + if (eventStatus === "queued") { + cancelButton = ( +
+ Cancel Sending +
+ ); + } + viewSourceButton = (
View Source @@ -86,6 +102,7 @@ module.exports = React.createClass({
{resendButton} {redactButton} + {cancelButton} {viewSourceButton}
); diff --git a/src/skins/vector/css/molecules/EventTile.css b/src/skins/vector/css/molecules/EventTile.css index 7e1f1a26c8..e3956bdb2b 100644 --- a/src/skins/vector/css/molecules/EventTile.css +++ b/src/skins/vector/css/molecules/EventTile.css @@ -111,7 +111,7 @@ limitations under the License. } .mx_EventTile_notSent { - color: #ddd; + color: #f44; } .mx_EventTile_highlight,