You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-07 23:02:56 +03:00
Remove deprecated calls of MatrixClient
(#4563)
This commit is contained in:
@@ -20,6 +20,7 @@ import { RelationType } from "../@types/event.ts";
|
|||||||
import { TypedEventEmitter } from "./typed-event-emitter.ts";
|
import { TypedEventEmitter } from "./typed-event-emitter.ts";
|
||||||
import { MatrixClient } from "../client.ts";
|
import { MatrixClient } from "../client.ts";
|
||||||
import { Room } from "./room.ts";
|
import { Room } from "./room.ts";
|
||||||
|
import { CryptoBackend } from "../common-crypto/CryptoBackend.ts";
|
||||||
|
|
||||||
export enum RelationsEvent {
|
export enum RelationsEvent {
|
||||||
Add = "Relations.add",
|
Add = "Relations.add",
|
||||||
@@ -323,8 +324,9 @@ export class Relations extends TypedEventEmitter<RelationsEvent, EventHandlerMap
|
|||||||
return event;
|
return event;
|
||||||
}, null);
|
}, null);
|
||||||
|
|
||||||
if (lastReplacement?.shouldAttemptDecryption() && this.client.isCryptoEnabled()) {
|
if (lastReplacement?.shouldAttemptDecryption() && this.client.getCrypto()) {
|
||||||
await lastReplacement.attemptDecryption(this.client.crypto!);
|
// Dirty but we are expecting to pass the cryptoBackend which is not accessible here
|
||||||
|
await lastReplacement.attemptDecryption(this.client.getCrypto() as CryptoBackend);
|
||||||
} else if (lastReplacement?.isBeingDecrypted()) {
|
} else if (lastReplacement?.isBeingDecrypted()) {
|
||||||
await lastReplacement.getDecryptionPromise();
|
await lastReplacement.getDecryptionPromise();
|
||||||
}
|
}
|
||||||
|
@@ -545,7 +545,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|||||||
* @returns Signals when all events have been decrypted
|
* @returns Signals when all events have been decrypted
|
||||||
*/
|
*/
|
||||||
public async decryptCriticalEvents(): Promise<void> {
|
public async decryptCriticalEvents(): Promise<void> {
|
||||||
if (!this.client.isCryptoEnabled()) return;
|
if (!this.client.getCrypto()) return;
|
||||||
|
|
||||||
const readReceiptEventId = this.getEventReadUpTo(this.client.getUserId()!, true);
|
const readReceiptEventId = this.getEventReadUpTo(this.client.getUserId()!, true);
|
||||||
const events = this.getLiveTimeline().getEvents();
|
const events = this.getLiveTimeline().getEvents();
|
||||||
@@ -567,7 +567,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|||||||
* @returns Signals when all events have been decrypted
|
* @returns Signals when all events have been decrypted
|
||||||
*/
|
*/
|
||||||
public async decryptAllEvents(): Promise<void> {
|
public async decryptAllEvents(): Promise<void> {
|
||||||
if (!this.client.isCryptoEnabled()) return;
|
if (!this.client.getCrypto()) return;
|
||||||
|
|
||||||
const decryptionPromises = this.getUnfilteredTimelineSet()
|
const decryptionPromises = this.getUnfilteredTimelineSet()
|
||||||
.getLiveTimeline()
|
.getLiveTimeline()
|
||||||
|
Reference in New Issue
Block a user