- val currentIdentities = identityLoader.loadIdentities()
-
- val onlyTrustedByAll = currentIdentities.mapValues { (ownIdentity, trustedIdentities) ->
+ val currentIdentities = identityLoader.loadAllIdentities()
+
+ val identitiesWithTrust = currentIdentities.values.flatten()
+ .groupBy { it.id }
+ .mapValues { (_, identities) ->
+ identities.reduce { accIdentity, identity ->
+ identity.trust.forEach { (ownIdentity: OwnIdentity?, trust: Trust?) ->
+ accIdentity.setTrust(ownIdentity, trust)
+ }
+ accIdentity
+ }
+ }
+
+ val onlyTrustedByAll = currentIdentities.mapValues { (_, trustedIdentities) ->