Skip to content

Commit 125e45c

Browse files
authored
Deprecate remaining legacy functions and move CryptoEvent.LegacyCryptoStoreMigrationProgress handler (#4560)
* Deprecate legacy functions in `MatrixClient` * Move `CryptoEvent.LegacyCryptoStoreMigrationProgress` handler in rust crypto * Remove `olmLib` usage in `MatrixClient`
1 parent 3781b6e commit 125e45c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/client.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { noUnsafeEventProps, QueryDict, replaceParam, safeSet, sleep } from "./u
4646
import { Direction, EventTimeline } from "./models/event-timeline.ts";
4747
import { IActionsObject, PushProcessor } from "./pushprocessor.ts";
4848
import { AutoDiscovery, AutoDiscoveryAction } from "./autodiscovery.ts";
49-
import * as olmlib from "./crypto/olmlib.ts";
5049
import { decodeBase64, encodeBase64, encodeUnpaddedBase64Url } from "./base64.ts";
5150
import { IExportedDevice as IExportedOlmDevice } from "./crypto/OlmDevice.ts";
5251
import { IOlmDevice } from "./crypto/algorithms/megolm.ts";
@@ -252,6 +251,9 @@ export type Store = IStore;
252251
export type ResetTimelineCallback = (roomId: string) => boolean;
253252

254253
const SCROLLBACK_DELAY_MS = 3000;
254+
/**
255+
* @deprecated Not supported for Rust Cryptography.
256+
*/
255257
export const CRYPTO_ENABLED: boolean = isCryptoAvailable();
256258
const TURN_CHECK_INTERVAL = 10 * 60 * 1000; // poll for turn credentials every 10 minutes
257259

@@ -2430,6 +2432,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
24302432
*
24312433
* @remarks
24322434
* Fires {@link CryptoEvent#DeviceVerificationChanged}
2435+
*
2436+
* @deprecated Not supported for Rust Cryptography.
24332437
*/
24342438
public setDeviceVerified(userId: string, deviceId: string, verified = true): Promise<void> {
24352439
const prom = this.setDeviceVerification(userId, deviceId, verified, null, null);
@@ -10115,7 +10119,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
1011510119
type: EventType.RoomEncryption,
1011610120
state_key: "",
1011710121
content: {
10118-
algorithm: olmlib.MEGOLM_ALGORITHM,
10122+
algorithm: "m.megolm.v1.aes-sha2",
1011910123
},
1012010124
},
1012110125
],

src/crypto-api/CryptoEventHandlerMap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ export type CryptoEventHandlerMap = {
2929
[CryptoEvent.KeysChanged]: (data: {}) => void;
3030
[CryptoEvent.WillUpdateDevices]: (users: string[], initialFetch: boolean) => void;
3131
[CryptoEvent.DevicesUpdated]: (users: string[], initialFetch: boolean) => void;
32+
[CryptoEvent.LegacyCryptoStoreMigrationProgress]: (progress: number, total: number) => void;
3233
} & RustBackupCryptoEventMap;

src/crypto/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ export type CryptoEventHandlerMap = CryptoApiCryptoEventHandlerMap & {
326326
*/
327327
[CryptoEvent.Warning]: (type: string) => void;
328328
[CryptoEvent.UserCrossSigningUpdated]: (userId: string) => void;
329-
330-
[CryptoEvent.LegacyCryptoStoreMigrationProgress]: (progress: number, total: number) => void;
331329
};
332330

333331
export class Crypto extends TypedEventEmitter<CryptoEvent, CryptoEventHandlerMap> implements CryptoBackend {

0 commit comments

Comments
 (0)