diff --git a/src/models/relations.ts b/src/models/relations.ts index 87a9b7522bb..bb7f05648d7 100644 --- a/src/models/relations.ts +++ b/src/models/relations.ts @@ -20,6 +20,7 @@ import { RelationType } from "../@types/event.ts"; import { TypedEventEmitter } from "./typed-event-emitter.ts"; import { MatrixClient } from "../client.ts"; import { Room } from "./room.ts"; +import { CryptoBackend } from "../common-crypto/CryptoBackend.ts"; export enum RelationsEvent { Add = "Relations.add", @@ -323,8 +324,9 @@ export class Relations extends TypedEventEmitter { * @returns Signals when all events have been decrypted */ public async decryptCriticalEvents(): Promise { - if (!this.client.isCryptoEnabled()) return; + if (!this.client.getCrypto()) return; const readReceiptEventId = this.getEventReadUpTo(this.client.getUserId()!, true); const events = this.getLiveTimeline().getEvents(); @@ -567,7 +567,7 @@ export class Room extends ReadReceipt { * @returns Signals when all events have been decrypted */ public async decryptAllEvents(): Promise { - if (!this.client.isCryptoEnabled()) return; + if (!this.client.getCrypto()) return; const decryptionPromises = this.getUnfilteredTimelineSet() .getLiveTimeline()