From b209cc551e0610624947347081044428f14dda85 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 15 Nov 2016 11:12:52 +0000 Subject: [PATCH] Update eventtiles when the events are decrypted Events are sometimes decrypted after they arrive, so add an eventlistener for it and update the tile. --- src/components/views/rooms/EventTile.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 375c00fed7..410ad2b953 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -146,6 +146,7 @@ module.exports = WithMatrixClient(React.createClass({ this._suppressReadReceiptAnimation = false; this.props.matrixClient.on("deviceVerificationChanged", this.onDeviceVerificationChanged); + this.props.mxEvent.on("Event.decrypted", this._onDecrypted); }, componentWillReceiveProps: function (nextProps) { @@ -170,6 +171,15 @@ module.exports = WithMatrixClient(React.createClass({ var client = this.props.matrixClient; client.removeListener("deviceVerificationChanged", this.onDeviceVerificationChanged); + this.props.mxEvent.removeListener("Event.decrypted", this._onDecrypted); + }, + + /** called when the event is decrypted after we show it. + */ + _onDecrypted: function() { + // we need to re-verify the sending device. + this._verifyEvent(this.props.mxEvent); + this.forceUpdate(); }, onDeviceVerificationChanged: function(userId, device) {