Add own identities to list of trusted identities.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:47:26 +0000 (17:47 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 15 Sep 2011 15:47:26 +0000 (17:47 +0200)
src/main/java/net/pterodactylus/wotns/freenet/wot/IdentityManager.java

index eefb372..1411ab3 100644 (file)
@@ -217,6 +217,17 @@ public class IdentityManager extends AbstractService {
                                        for (Identity identity : trustedIdentities) {
                                                identities.put(identity.getId(), identity);
                                        }
+
+                                       /* add own identities, too, as long as the WoT doesn’t do that. */
+                                       for (OwnIdentity additionalOwnIdentity : ownIdentities) {
+                                               if (additionalOwnIdentity == ownIdentity) {
+                                                       continue;
+                                               }
+                                               if ((context != null) && !additionalOwnIdentity.hasContext(context)) {
+                                                       continue;
+                                               }
+                                               identities.put(additionalOwnIdentity.getId(), additionalOwnIdentity);
+                                       }
                                }
                                identitiesLoaded = true;
                        } catch (WebOfTrustException wote1) {