You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
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:
@@ -78,6 +78,18 @@ class MatrixClientPeg {
|
||||
}
|
||||
|
||||
async start() {
|
||||
// try to initialise e2e on the new client
|
||||
try {
|
||||
// check that we have a version of the js-sdk which includes initCrypto
|
||||
if (this.matrixClient.initCrypto) {
|
||||
await this.matrixClient.initCrypto();
|
||||
}
|
||||
} catch(e) {
|
||||
// this can happen for a number of reasons, the most likely being
|
||||
// that the olm library was missing. It's not fatal.
|
||||
console.warn("Unable to initialise e2e: " + e);
|
||||
}
|
||||
|
||||
const opts = utils.deepCopy(this.opts);
|
||||
// the react sdk doesn't work without this, so don't allow
|
||||
opts.pendingEventOrdering = "detached";
|
||||
|
||||
Reference in New Issue
Block a user