fix: Better detection if x-signing and megolm backup is enabled
This commit is contained in:
parent
9fa36f736b
commit
2d70360a8d
|
|
@ -55,9 +55,9 @@ class CrossSigning {
|
|||
}
|
||||
|
||||
bool get enabled =>
|
||||
client.accountData[EventTypes.CrossSigningSelfSigning] != null &&
|
||||
client.accountData[EventTypes.CrossSigningUserSigning] != null &&
|
||||
client.accountData[EventTypes.CrossSigningMasterKey] != null;
|
||||
encryption.ssss.isSecret(EventTypes.CrossSigningSelfSigning) &&
|
||||
encryption.ssss.isSecret(EventTypes.CrossSigningUserSigning) &&
|
||||
encryption.ssss.isSecret(EventTypes.CrossSigningMasterKey);
|
||||
|
||||
Future<bool> isCached() async {
|
||||
if (!enabled) {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class KeyManager {
|
|||
});
|
||||
}
|
||||
|
||||
bool get enabled => client.accountData[MEGOLM_KEY] != null;
|
||||
bool get enabled => encryption.ssss.isSecret(MEGOLM_KEY);
|
||||
|
||||
/// clear all cached inbound group sessions. useful for testing
|
||||
void clearInboundGroupSessions() {
|
||||
|
|
|
|||
|
|
@ -264,6 +264,10 @@ class SSSS {
|
|||
}
|
||||
}
|
||||
|
||||
bool isSecret(String type) =>
|
||||
client.accountData[type] != null &&
|
||||
client.accountData[type].content['encrypted'] is Map;
|
||||
|
||||
Future<String> getCached(String type) async {
|
||||
if (client.database == null) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue