Always check the full set of own identities.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Nov 2010 20:02:02 +0000 (21:02 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Nov 2010 20:02:02 +0000 (21:02 +0100)
src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java

index ef8b3b6..7796557 100644 (file)
@@ -263,6 +263,15 @@ public class IdentityManager extends AbstractService {
                        Set<OwnIdentity> 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())) {