From: David ‘Bombe’ Roden Date: Fri, 17 Apr 2020 18:14:36 +0000 (+0200) Subject: 🔊 Log how much trust-all would reduce identity amount X-Git-Tag: v82^2~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a6aaf80dbee1c4b6e70159bf6b3c26609d8c3974;p=Sone.git 🔊 Log how much trust-all would reduce identity amount --- 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 67e70e0..5f087c7 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt @@ -58,6 +58,13 @@ class IdentityManagerImpl @Inject constructor( try { val currentIdentities = identityLoader.loadIdentities() + val onlyTrustedByAll = currentIdentities.mapValues { (ownIdentity, trustedIdentities) -> + trustedIdentities.filter { trustedIdentity -> + currentIdentities.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() }})).") + val identityChangeEventSender = IdentityChangeEventSender(eventBus, oldIdentities) identityChangeEventSender.detectChanges(currentIdentities)