1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

Element-R: stub implementations of some methods (#3075)

These are all called by the react-sdk when showing an encrypted event:

 * `getEventEncryptionInfo`
 * `checkUserTrust`
 * `checkDeviceTrust`

I don't particularly want to keep this API, but as a rapid means to an end,
let's stub them for now.
This commit is contained in:
Richard van der Hoff
2023-01-18 12:07:49 +00:00
committed by GitHub
parent 85b34b46c5
commit d6b8332567
4 changed files with 96 additions and 6 deletions

View File

@@ -2507,10 +2507,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @returns
*/
public checkUserTrust(userId: string): UserTrustLevel {
if (!this.crypto) {
if (!this.cryptoBackend) {
throw new Error("End-to-end encryption disabled");
}
return this.crypto.checkUserTrust(userId);
return this.cryptoBackend.checkUserTrust(userId);
}
/**
@@ -2522,10 +2522,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @param deviceId - The ID of the device to check
*/
public checkDeviceTrust(userId: string, deviceId: string): DeviceTrustLevel {
if (!this.crypto) {
if (!this.cryptoBackend) {
throw new Error("End-to-end encryption disabled");
}
return this.crypto.checkDeviceTrust(userId, deviceId);
return this.cryptoBackend.checkDeviceTrust(userId, deviceId);
}
/**
@@ -2689,10 +2689,10 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @returns The event information.
*/
public getEventEncryptionInfo(event: MatrixEvent): IEncryptedEventInfo {
if (!this.crypto) {
if (!this.cryptoBackend) {
throw new Error("End-to-end encryption disabled");
}
return this.crypto.getEventEncryptionInfo(event);
return this.cryptoBackend.getEventEncryptionInfo(event);
}
/**