fix: Better logic when to auto-trigger self-sign

This commit is contained in:
Sorunome 2021-02-13 15:00:57 +01:00
parent 1f7e517dbf
commit 34b15e45fc
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 5 additions and 1 deletions

View File

@ -692,7 +692,11 @@ class OpenSSSS {
// first try to cache all secrets that aren't cached yet // first try to cache all secrets that aren't cached yet
await maybeCacheAll(); await maybeCacheAll();
// now try to self-sign // now try to self-sign
if (ssss.encryption.crossSigning.enabled && ssss.client.isUnknownSession) { if (ssss.encryption.crossSigning.enabled &&
ssss.client.userDeviceKeys[ssss.client.userID]?.masterKey != null &&
(ssss.client.isUnknownSession ||
!ssss.client.userDeviceKeys[ssss.client.userID].masterKey
.directVerified)) {
try { try {
await ssss.encryption.crossSigning.selfSign(openSsss: this); await ssss.encryption.crossSigning.selfSign(openSsss: this);
} catch (e, s) { } catch (e, s) {