From: David ‘Bombe’ Roden Date: Fri, 17 Apr 2020 23:29:40 +0000 (+0200) Subject: 🚧 Disregard identities that don’t trust anyone X-Git-Tag: v82^2~15 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e2eb4417311b9c18e297c2dff2a51d508fffa1d8;p=Sone.git 🚧 Disregard identities that don’t trust anyone --- diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt index 5f087c7..f0e08d4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt @@ -60,7 +60,7 @@ class IdentityManagerImpl @Inject constructor( val onlyTrustedByAll = currentIdentities.mapValues { (ownIdentity, trustedIdentities) -> trustedIdentities.filter { trustedIdentity -> - currentIdentities.all { trustedIdentity in it.value } + currentIdentities.filterValues { it.isNotEmpty() }.all { trustedIdentity in it.value } } } logger.log(Level.FINE, "Reduced (${currentIdentities.size},(${currentIdentities.values.joinToString { it.size.toString() }})) identities to (${onlyTrustedByAll.size},(${onlyTrustedByAll.values.joinToString { it.size.toString() }})).")