Merge branch 'soru/better-detect' into 'main'
fix: Better detection if x-signing and megolm backup is enabled See merge request famedly/famedlysdk!645
This commit is contained in:
commit
28f6ab6ff2
|
|
@ -55,9 +55,9 @@ class CrossSigning {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get enabled =>
|
bool get enabled =>
|
||||||
client.accountData[EventTypes.CrossSigningSelfSigning] != null &&
|
encryption.ssss.isSecret(EventTypes.CrossSigningSelfSigning) &&
|
||||||
client.accountData[EventTypes.CrossSigningUserSigning] != null &&
|
encryption.ssss.isSecret(EventTypes.CrossSigningUserSigning) &&
|
||||||
client.accountData[EventTypes.CrossSigningMasterKey] != null;
|
encryption.ssss.isSecret(EventTypes.CrossSigningMasterKey);
|
||||||
|
|
||||||
Future<bool> isCached() async {
|
Future<bool> isCached() async {
|
||||||
if (!enabled) {
|
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
|
/// clear all cached inbound group sessions. useful for testing
|
||||||
void clearInboundGroupSessions() {
|
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 {
|
Future<String> getCached(String type) async {
|
||||||
if (client.database == null) {
|
if (client.database == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue