diff --git a/src/e2ee/RustEngine.ts b/src/e2ee/RustEngine.ts index f8ba1aca..d1b3bd83 100644 --- a/src/e2ee/RustEngine.ts +++ b/src/e2ee/RustEngine.ts @@ -18,7 +18,7 @@ import { MatrixClient } from "../MatrixClient"; import { ICryptoRoomInformation } from "./ICryptoRoomInformation"; import { EncryptionAlgorithm } from "../models/Crypto"; import { EncryptionEvent } from "../models/events/EncryptionEvent"; -import { IKeyBackupInfoRetrieved, KeyBackupVersion } from "../models/KeyBackup"; +import { ICurve25519AuthData, IKeyBackupInfoRetrieved, KeyBackupVersion } from "../models/KeyBackup"; /** * @internal @@ -135,14 +135,14 @@ export class RustEngine { } public async enableKeyBackup(info: IKeyBackupInfoRetrieved) { - LogService.warn("RustEngine", "**STUB** Server-side key backups not yet implemented!"); this.keyBackupVersion = info.version; - // await this.machine.enableBackupV1(info); + // TODO Error with message if the key backup uses an unsupported auth_data type + await this.machine.enableBackupV1((info.auth_data as ICurve25519AuthData).public_key, info.version); } public async disableKeyBackup() { this.keyBackupVersion = undefined; - // await this.machine.disableBackup(); + await this.machine.disableBackup(); } private async processKeysClaimRequest(request: KeysClaimRequest) {