Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update eventtiles when the events are decrypted #556

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/views/rooms/EventTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down