Prepare for asynchronous e2e APIs

the js-sdk is making some of its APIs asynchronous, and adding an `initCrypto`
method which you have to call.

Particular methods we need to worry about are:

* `getStoredDevice`
* `getStoredDevicesForUser`
* `getEventSenderDeviceInfo`
* `isEventSenderVerified`
This commit is contained in:
Richard van der Hoff
2017-07-18 23:47:36 +01:00
parent b9dfaf777e
commit 4998d1b359
5 changed files with 93 additions and 62 deletions
+4 -5
View File
@@ -193,13 +193,12 @@ module.exports = withMatrixClient(React.createClass({
}
},
_verifyEvent: function(mxEvent) {
var verified = null;
if (mxEvent.isEncrypted()) {
verified = this.props.matrixClient.isEventSenderVerified(mxEvent);
_verifyEvent: async function(mxEvent) {
if (!mxEvent.isEncrypted()) {
return;
}
const verified = await this.props.matrixClient.isEventSenderVerified(mxEvent);
this.setState({
verified: verified
});