1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

ElementR: Check key backup when user identity changes (#3760)

Fixes vector-im/element-web#26244
This commit is contained in:
Florian Duros
2023-10-03 14:38:51 +02:00
committed by GitHub
parent 6a761af867
commit 2e4276437a
2 changed files with 44 additions and 0 deletions

View File

@@ -1339,6 +1339,12 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, RustCryptoEv
public async onUserIdentityUpdated(userId: RustSdkCryptoJs.UserId): Promise<void> {
const newVerification = await this.getUserVerificationStatus(userId.toString());
this.emit(CryptoEvent.UserTrustStatusChanged, userId.toString(), newVerification);
// If our own user identity has changed, we may now trust the key backup where we did not before.
// So, re-check the key backup status and enable it if available.
if (userId.toString() === this.userId) {
await this.checkKeyBackupAndEnable();
}
}
/**