From 82aa603596ccd74c8cdbbd5ac9257f2d9f5eeaa6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Sep 2015 16:14:19 +0100 Subject: [PATCH] Merge in resend support --- src/controllers/molecules/MessageTile.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/controllers/molecules/MessageTile.js b/src/controllers/molecules/MessageTile.js index 953e33b516..47b616e724 100644 --- a/src/controllers/molecules/MessageTile.js +++ b/src/controllers/molecules/MessageTile.js @@ -23,6 +23,28 @@ module.exports = { var actions = MatrixClientPeg.get().getPushActionsForEvent(this.props.mxEvent); if (!actions || !actions.tweaks) { return false; } return actions.tweaks.highlight; + }, + + getInitialState: function() { + return { + resending: false + }; + }, + + onResend: function() { + var self = this; + self.setState({ + resending: true + }); + MatrixClientPeg.get().resendEvent( + this.props.mxEvent, MatrixClientPeg.get().getRoom( + this.props.mxEvent.getRoomId() + ) + ).finally(function() { + self.setState({ + resending: false + }); + }) } };