chore: enable avoid_bool_literals_in_conditional_expressions
This commit is contained in:
parent
a0970b7fcb
commit
5dc3adadfc
|
|
@ -2,17 +2,18 @@ include: package:lints/recommended.yaml
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
avoid_print: true
|
|
||||||
prefer_final_locals: true
|
|
||||||
prefer_final_in_for_each: true
|
|
||||||
sort_pub_dependencies: true
|
|
||||||
always_use_package_imports: true
|
|
||||||
always_declare_return_types: true
|
always_declare_return_types: true
|
||||||
|
always_use_package_imports: true
|
||||||
|
avoid_bool_literals_in_conditional_expressions: true
|
||||||
|
avoid_print: true
|
||||||
|
non_constant_identifier_names: false # seems to wrongly diagnose static const variables
|
||||||
|
prefer_final_in_for_each: true
|
||||||
|
prefer_final_locals: true
|
||||||
prefer_single_quotes: true
|
prefer_single_quotes: true
|
||||||
sort_child_properties_last: true
|
sort_child_properties_last: true
|
||||||
|
sort_pub_dependencies: true
|
||||||
unawaited_futures: true
|
unawaited_futures: true
|
||||||
unsafe_html: true
|
unsafe_html: true
|
||||||
non_constant_identifier_names: false # seems to wrongly diagnose static const variables
|
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
errors:
|
errors:
|
||||||
|
|
|
||||||
|
|
@ -267,11 +267,8 @@ class KeyVerification {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `qrCanWork` - qr cannot work if we are verifying another master key but our own is unverified
|
/// `qrCanWork` - qr cannot work if we are verifying another master key but our own is unverified
|
||||||
final qrCanWork = (userId != client.userID)
|
final qrCanWork = (userId == client.userID) ||
|
||||||
? ((client.userDeviceKeys[client.userID]?.masterKey?.verified ?? false)
|
((client.userDeviceKeys[client.userID]?.masterKey?.verified ?? false));
|
||||||
? true
|
|
||||||
: false)
|
|
||||||
: true;
|
|
||||||
|
|
||||||
if (client.verificationMethods.contains(KeyVerificationMethod.qrShow) &&
|
if (client.verificationMethods.contains(KeyVerificationMethod.qrShow) &&
|
||||||
qrCanWork) {
|
qrCanWork) {
|
||||||
|
|
|
||||||
|
|
@ -433,17 +433,16 @@ class DeviceKeys extends SignableKey {
|
||||||
bool? _validSelfSignature;
|
bool? _validSelfSignature;
|
||||||
bool get selfSigned =>
|
bool get selfSigned =>
|
||||||
_validSelfSignature ??
|
_validSelfSignature ??
|
||||||
(_validSelfSignature = (deviceId != null &&
|
(_validSelfSignature = deviceId != null &&
|
||||||
signatures
|
signatures
|
||||||
?.tryGetMap<String, Object?>(userId)
|
?.tryGetMap<String, Object?>(userId)
|
||||||
?.tryGet<String>('ed25519:$deviceId') ==
|
?.tryGet<String>('ed25519:$deviceId') !=
|
||||||
null
|
null &&
|
||||||
? false
|
|
||||||
// without libolm we still want to be able to add devices. In that case we ofc just can't
|
// without libolm we still want to be able to add devices. In that case we ofc just can't
|
||||||
// verify the signature
|
// verify the signature
|
||||||
: _verifySignature(
|
_verifySignature(
|
||||||
ed25519Key!, signatures![userId]!['ed25519:$deviceId']!,
|
ed25519Key!, signatures![userId]!['ed25519:$deviceId']!,
|
||||||
isSignatureWithoutLibolmValid: true)));
|
isSignatureWithoutLibolmValid: true));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get blocked => super.blocked || !selfSigned;
|
bool get blocked => super.blocked || !selfSigned;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue