Remove trusted identities for an own identity if the own identity is removed.
[WoTNS.git] / src / main / java / net / pterodactylus / wotns / freenet / wot / IdentityManager.java
index 2958ca1..ea90dac 100644 (file)
@@ -232,7 +232,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 +285,7 @@ public class IdentityManager extends AbstractService {
                        for (OwnIdentity oldOwnIdentity : currentOwnIdentities.values()) {
                                if (!newOwnIdentities.containsKey(oldOwnIdentity.getId())) {
                                        identityListenerManager.fireOwnIdentityRemoved(oldOwnIdentity);
+                                       currentTrustedIdentities.remove(oldOwnIdentity);
                                }
                        }