Skip to content

Commit b5e80c3

Browse files
committed
Remove legacy crypto support in sync api
1 parent a6fd28b commit b5e80c3

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
15541554
*/
15551555
protected buildSyncApiOptions(): SyncApiOptions {
15561556
return {
1557-
crypto: this.crypto,
15581557
cryptoCallbacks: this.cryptoBackend,
15591558
canResetEntireTimeline: (roomId: string): boolean => {
15601559
if (!this.canResetTimelineCallback) {

src/sync.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import { BeaconEvent } from "./models/beacon.ts";
5959
import { IEventsResponse } from "./@types/requests.ts";
6060
import { UNREAD_THREAD_NOTIFICATIONS } from "./@types/sync.ts";
6161
import { Feature, ServerSupport } from "./feature.ts";
62-
import { Crypto } from "./crypto/index.ts";
6362
import { KnownMembership } from "./@types/membership.ts";
6463

6564
const DEBUG = true;
@@ -116,13 +115,6 @@ function debuglog(...params: any[]): void {
116115
* Options passed into the constructor of SyncApi by MatrixClient
117116
*/
118117
export interface SyncApiOptions {
119-
/**
120-
* Crypto manager
121-
*
122-
* @deprecated in favour of cryptoCallbacks
123-
*/
124-
crypto?: Crypto;
125-
126118
/**
127119
* If crypto is enabled on our client, callbacks into the crypto module
128120
*/
@@ -642,9 +634,6 @@ export class SyncApi {
642634
}
643635
this.opts.filter.setLazyLoadMembers(true);
644636
}
645-
if (this.opts.lazyLoadMembers) {
646-
this.syncOpts.crypto?.enableLazyLoading();
647-
}
648637
};
649638

650639
private storeClientOptions = async (): Promise<void> => {
@@ -880,12 +869,6 @@ export class SyncApi {
880869
catchingUp: this.catchingUp,
881870
};
882871

883-
if (this.syncOpts.crypto) {
884-
// tell the crypto module we're about to process a sync
885-
// response
886-
await this.syncOpts.crypto.onSyncWillProcess(syncEventData);
887-
}
888-
889872
try {
890873
await this.processSyncResponse(syncEventData, data);
891874
} catch (e) {
@@ -920,15 +903,6 @@ export class SyncApi {
920903
this.updateSyncState(SyncState.Syncing, syncEventData);
921904

922905
if (this.client.store.wantsSave()) {
923-
// We always save the device list (if it's dirty) before saving the sync data:
924-
// this means we know the saved device list data is at least as fresh as the
925-
// stored sync data which means we don't have to worry that we may have missed
926-
// device changes. We can also skip the delay since we're not calling this very
927-
// frequently (and we don't really want to delay the sync for it).
928-
if (this.syncOpts.crypto) {
929-
await this.syncOpts.crypto.saveDeviceList(0);
930-
}
931-
932906
// tell databases that everything is now in a consistent state and can be saved.
933907
await this.client.store.save();
934908
}

0 commit comments

Comments
 (0)