mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 11:48:51 +03:00
Better contract. Explicit parameter usage
This commit is contained in:
parent
2858401a12
commit
13cf510e8a
2 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ data class KeysBackupVersionTrust(
|
|||
* Flag to indicate if the backup is trusted.
|
||||
* true if there is a signature that is valid & from a trusted device.
|
||||
*/
|
||||
val usable: Boolean = false,
|
||||
val usable: Boolean,
|
||||
|
||||
/**
|
||||
* Signatures found in the backup version.
|
||||
|
|
|
@ -413,13 +413,13 @@ internal class DefaultKeysBackupService @Inject constructor(
|
|||
|
||||
if (authData == null || authData.publicKey.isEmpty() || authData.signatures.isNullOrEmpty()) {
|
||||
Timber.v("getKeysBackupTrust: Key backup is absent or missing required data")
|
||||
return KeysBackupVersionTrust()
|
||||
return KeysBackupVersionTrust(usable = false)
|
||||
}
|
||||
|
||||
val mySigs = authData.signatures[userId]
|
||||
if (mySigs.isNullOrEmpty()) {
|
||||
Timber.v("getKeysBackupTrust: Ignoring key backup because it lacks any signatures from this user")
|
||||
return KeysBackupVersionTrust()
|
||||
return KeysBackupVersionTrust(usable = false)
|
||||
}
|
||||
|
||||
var keysBackupVersionTrustIsUsable = false
|
||||
|
|
Loading…
Add table
Reference in a new issue