Merge pull request #8352 from vector-im/feature/bca/fix_is_identity_trusted_api
fix rust isCrossSigningVerified
This commit is contained in:
commit
63451611a9
|
@ -0,0 +1 @@
|
||||||
|
Fix: RustCrossSigning service API confusion (identity trusted vs own device trusted by identity)
|
|
@ -24,7 +24,7 @@ import org.matrix.android.sdk.api.util.Optional
|
||||||
|
|
||||||
interface CrossSigningService {
|
interface CrossSigningService {
|
||||||
/**
|
/**
|
||||||
* Is our own device signed by our own cross signing identity.
|
* Is our published identity trusted.
|
||||||
*/
|
*/
|
||||||
suspend fun isCrossSigningVerified(): Boolean
|
suspend fun isCrossSigningVerified(): Boolean
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,11 @@ internal class RustCrossSigningService @Inject constructor(
|
||||||
) : CrossSigningService {
|
) : CrossSigningService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is our own device signed by our own cross signing identity
|
* Is our own identity trusted
|
||||||
*/
|
*/
|
||||||
override suspend fun isCrossSigningVerified(): Boolean {
|
override suspend fun isCrossSigningVerified(): Boolean {
|
||||||
return when (val identity = olmMachine.getIdentity(olmMachine.userId())) {
|
return when (val identity = olmMachine.getIdentity(olmMachine.userId())) {
|
||||||
is OwnUserIdentity -> identity.trustsOurOwnDevice()
|
is OwnUserIdentity -> identity.verified()
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue