From ad7d7154f4f4b9751993a42e03b2f3a6e8cf3738 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 1 May 2020 15:01:13 +0100 Subject: [PATCH 1/2] Emit event when a trusted self-key is stored This will cause our own user trust status to change, so emit an event to say so. --- src/crypto/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crypto/index.js b/src/crypto/index.js index 77415fbb2..6d79583d7 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -2027,6 +2027,8 @@ Crypto.prototype.setDeviceVerification = async function( if (!this._crossSigningInfo.getId() && userId === this._crossSigningInfo.userId) { this._storeTrustedSelfKeys(xsk.keys); + // This will cause our own user trust to change, so emit the event + this.emit("userTrustStatusChanged", this._userId, this.checkUserTrust(userId)); } // Now sign the master key with our user signing key (unless it's ourself) From 4946b55c21afb70869c2aa281ee560fff04e4365 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 1 May 2020 15:13:02 +0100 Subject: [PATCH 2/2] lint --- src/crypto/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crypto/index.js b/src/crypto/index.js index 6d79583d7..79b914e30 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -2028,7 +2028,9 @@ Crypto.prototype.setDeviceVerification = async function( if (!this._crossSigningInfo.getId() && userId === this._crossSigningInfo.userId) { this._storeTrustedSelfKeys(xsk.keys); // This will cause our own user trust to change, so emit the event - this.emit("userTrustStatusChanged", this._userId, this.checkUserTrust(userId)); + this.emit( + "userTrustStatusChanged", this._userId, this.checkUserTrust(userId), + ); } // Now sign the master key with our user signing key (unless it's ourself)