You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-01 04:43:29 +03:00
Fix remaining hot paths
This commit is contained in:
@@ -667,7 +667,7 @@ export class MatrixClient extends EventEmitter {
|
||||
}
|
||||
return this.canResetTimelineCallback(roomId);
|
||||
};
|
||||
this.syncApi = new SyncApi(this, opts);
|
||||
this.syncApi = new SyncApi(this, this.clientOpts);
|
||||
this.syncApi.sync();
|
||||
|
||||
if (opts.clientWellKnownPollPeriod !== undefined) {
|
||||
@@ -1420,6 +1420,13 @@ export class MatrixClient extends EventEmitter {
|
||||
return this.crypto.beginKeyVerification(method, userId, deviceId);
|
||||
}
|
||||
|
||||
public checkSecretStorageKey(key: any, info: any): Promise<any> { // TODO: Types
|
||||
if (!this.crypto) {
|
||||
throw new Error("End-to-end encryption disabled");
|
||||
}
|
||||
return this.crypto.checkSecretStorageKey(key, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the global override for whether the client should ever send encrypted
|
||||
* messages to unverified devices. This provides the default for rooms which
|
||||
@@ -4876,14 +4883,7 @@ export class MatrixClient extends EventEmitter {
|
||||
highlights: [],
|
||||
};
|
||||
|
||||
// TODO: @@TR: wtf is this
|
||||
// prev:
|
||||
/*
|
||||
return this.search({ body: body }).then(
|
||||
this._processRoomEventsSearch.bind(this, searchResults),
|
||||
);
|
||||
*/
|
||||
return this.search({ body: body }).then(res => this.processRoomEventsSearch(res, searchResults));
|
||||
return this.search({ body: body }).then(res => this.processRoomEventsSearch(searchResults, res));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4911,10 +4911,9 @@ export class MatrixClient extends EventEmitter {
|
||||
next_batch: searchResults.next_batch,
|
||||
};
|
||||
|
||||
// TODO: @@TR: wtf
|
||||
const promise = this.search(searchOpts).then(
|
||||
this.processRoomEventsSearch.bind(this, searchResults),
|
||||
).finally(() => {
|
||||
const promise = this.search(searchOpts)
|
||||
.then(res => this.processRoomEventsSearch(searchResults, res))
|
||||
.finally(() => {
|
||||
searchResults.pendingRequest = null;
|
||||
});
|
||||
searchResults.pendingRequest = promise;
|
||||
|
||||
@@ -444,7 +444,7 @@ export class SecretStorage extends EventEmitter {
|
||||
&& this._incomingRequests[deviceId][content.request_id]) {
|
||||
logger.info("received request cancellation for secret (" + sender
|
||||
+ ", " + deviceId + ", " + content.request_id + ")");
|
||||
this.baseApis.emit("crypto.secrets.requestCancelled", {
|
||||
this._baseApis.emit("crypto.secrets.requestCancelled", {
|
||||
user_id: sender,
|
||||
device_id: deviceId,
|
||||
request_id: content.request_id,
|
||||
|
||||
@@ -495,7 +495,7 @@ Crypto.prototype.bootstrapCrossSigning = async function({
|
||||
} = {}) {
|
||||
logger.log("Bootstrapping cross-signing");
|
||||
|
||||
const delegateCryptoCallbacks = this.baseApis.cryptoCallbacks;
|
||||
const delegateCryptoCallbacks = this._baseApis.cryptoCallbacks;
|
||||
const builder = new EncryptionSetupBuilder(
|
||||
this._baseApis.store.accountData,
|
||||
delegateCryptoCallbacks,
|
||||
|
||||
Reference in New Issue
Block a user