From: David ‘Bombe’ Roden Date: Wed, 10 Nov 2010 20:02:02 +0000 (+0100) Subject: Always check the full set of own identities. X-Git-Tag: 0.2.1~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e01b70a4ccf10908ffdf694d857c7df1d1d48dca;p=Sone.git Always check the full set of own identities. --- diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java index ef8b3b6..7796557 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -263,6 +263,15 @@ public class IdentityManager extends AbstractService { Set ownIdentities; try { ownIdentities = webOfTrustConnector.loadAllOwnIdentities(); + + /* check for changes. */ + for (OwnIdentity ownIdentity : ownIdentities) { + currentOwnIdentities.put(ownIdentity.getId(), ownIdentity); + } + checkOwnIdentities(currentOwnIdentities); + + /* now filter for context and get all identities. */ + currentOwnIdentities.clear(); for (OwnIdentity ownIdentity : ownIdentities) { if ((context != null) && !ownIdentity.hasContext(context)) { continue; @@ -273,8 +282,6 @@ public class IdentityManager extends AbstractService { } } - checkOwnIdentities(currentOwnIdentities); - /* find removed identities. */ for (Identity oldIdentity : oldIdentities.values()) { if (!currentIdentities.containsKey(oldIdentity.getId())) {