Actually return the trusted identities.
[WoTNS.git] / src / main / java / net / pterodactylus / wotns / freenet / wot / IdentityManager.java
index 2958ca1..17c440e 100644 (file)
@@ -192,6 +192,7 @@ public class IdentityManager extends AbstractService {
                                newTrustedIdentities.put(trustedIdentity.getId(), trustedIdentity);
                        }
                        checkTrustedIdentities(ownIdentity, newTrustedIdentities);
+                       identities.addAll(trustedIdentities);
                } catch (WebOfTrustException wote1) {
                        logger.log(Level.WARNING, String.format("Could not load all trusted identities for %s.", ownIdentity), wote1);
                }
@@ -232,7 +233,10 @@ public class IdentityManager extends AbstractService {
                                                identities.put(identity.getId(), identity);
                                        }
 
-                                       /* add own identities, too, as long as the WoT doesn’t do that. */
+                                       /*
+                                        * add own identities, too, as long as the WoT doesn’t do
+                                        * that.
+                                        */
                                        for (OwnIdentity additionalOwnIdentity : ownIdentities) {
                                                if (additionalOwnIdentity == ownIdentity) {
                                                        continue;
@@ -282,6 +286,7 @@ public class IdentityManager extends AbstractService {
                        for (OwnIdentity oldOwnIdentity : currentOwnIdentities.values()) {
                                if (!newOwnIdentities.containsKey(oldOwnIdentity.getId())) {
                                        identityListenerManager.fireOwnIdentityRemoved(oldOwnIdentity);
+                                       currentTrustedIdentities.remove(oldOwnIdentity);
                                }
                        }