summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8952f84)
This prevents an old identity object from being cached forever in the
resolver.
private final IdentityManager identityManager;
private final IdentityManager identityManager;
- private OwnIdentity ownIdentity;
+ private String ownIdentityId;
public Resolver(IdentityManager identityManager) {
this.identityManager = identityManager;
}
public Resolver(IdentityManager identityManager) {
this.identityManager = identityManager;
}
- public void setOwnIdentity(OwnIdentity ownIdentity) {
- this.ownIdentity = ownIdentity;
+ public void setOwnIdentityId(String ownIdentityId) {
+ this.ownIdentityId = ownIdentityId;
}
@SuppressWarnings("hiding")
final OwnIdentity ownIdentity;
}
@SuppressWarnings("hiding")
final OwnIdentity ownIdentity;
- if (this.ownIdentity == null) {
+ if (this.ownIdentityId == null) {
Set<OwnIdentity> ownIdentities = identityManager.getAllOwnIdentities();
if (!ownIdentities.isEmpty()) {
ownIdentity = ownIdentities.iterator().next();
Set<OwnIdentity> ownIdentities = identityManager.getAllOwnIdentities();
if (!ownIdentities.isEmpty()) {
ownIdentity = ownIdentities.iterator().next();
ownIdentity = null;
}
} else {
ownIdentity = null;
}
} else {
- ownIdentity = this.ownIdentity;
+ ownIdentity = identityManager.getOwnIdentity(ownIdentityId);
}
if (ownIdentity == null) {
return null;
}
if (ownIdentity == null) {
return null;
import net.pterodactylus.util.version.Version;
import net.pterodactylus.wotns.freenet.plugin.PluginConnector;
import net.pterodactylus.wotns.freenet.wot.IdentityManager;
import net.pterodactylus.util.version.Version;
import net.pterodactylus.wotns.freenet.plugin.PluginConnector;
import net.pterodactylus.wotns.freenet.wot.IdentityManager;
-import net.pterodactylus.wotns.freenet.wot.OwnIdentity;
import net.pterodactylus.wotns.freenet.wot.WebOfTrustConnector;
import net.pterodactylus.wotns.ui.web.WebInterface;
import freenet.client.HighLevelSimpleClient;
import net.pterodactylus.wotns.freenet.wot.WebOfTrustConnector;
import net.pterodactylus.wotns.ui.web.WebInterface;
import freenet.client.HighLevelSimpleClient;
identityManager.start();
resolver = new Resolver(identityManager);
identityManager.start();
resolver = new Resolver(identityManager);
- OwnIdentity bombeIdentity = identityManager.getOwnIdentity("e3myoFyp5avg6WYN16ImHri6J7Nj8980Fm~aQe4EX1U");
- resolver.setOwnIdentity(bombeIdentity);
+ resolver.setOwnIdentityId("e3myoFyp5avg6WYN16ImHri6J7Nj8980Fm~aQe4EX1U");
webInterface = new WebInterface(this);
webInterface = new WebInterface(this);