projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sone Inserters are indexed by Sones, not by IDs.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
core
/
Core.java
diff --git
a/src/main/java/net/pterodactylus/sone/core/Core.java
b/src/main/java/net/pterodactylus/sone/core/Core.java
index
265b8e1
..
dc6516d
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-436,10
+436,6
@@
public class Core implements IdentityListener {
return null;
}
synchronized (localSones) {
return null;
}
synchronized (localSones) {
- if (localSones.containsKey(ownIdentity.getId())) {
- logger.log(Level.FINE, "Tried to add known local Sone: %s", ownIdentity);
- return localSones.get(ownIdentity.getId());
- }
final Sone sone;
try {
sone = getLocalSone(ownIdentity.getId()).setIdentity(ownIdentity).setInsertUri(new FreenetURI(ownIdentity.getInsertUri())).setRequestUri(new FreenetURI(ownIdentity.getRequestUri()));
final Sone sone;
try {
sone = getLocalSone(ownIdentity.getId()).setIdentity(ownIdentity).setInsertUri(new FreenetURI(ownIdentity.getInsertUri())).setRequestUri(new FreenetURI(ownIdentity.getRequestUri()));
@@
-489,14
+485,19
@@
public class Core implements IdentityListener {
return null;
}
synchronized (remoteSones) {
return null;
}
synchronized (remoteSones) {
- if (remoteSones.containsKey(identity.getId())) {
- logger.log(Level.FINE, "Identity already exists: %s", identity);
- return remoteSones.get(identity.getId());
- }
- Sone sone = new Sone(identity);
+ final Sone sone = getRemoteSone(identity.getId()).setIdentity(identity);
sone.setRequestUri(getSoneUri(identity.getRequestUri(), identity.getProperty("Sone.LatestEdition")));
remoteSones.put(identity.getId(), sone);
soneDownloader.addSone(sone);
sone.setRequestUri(getSoneUri(identity.getRequestUri(), identity.getProperty("Sone.LatestEdition")));
remoteSones.put(identity.getId(), sone);
soneDownloader.addSone(sone);
+ new Thread(new Runnable() {
+
+ @Override
+ @SuppressWarnings("synthetic-access")
+ public void run() {
+ soneDownloader.fetchSone(sone);
+ }
+
+ }, "Sone Downloader").start();
setSoneStatus(sone, SoneStatus.idle);
return sone;
}
setSoneStatus(sone, SoneStatus.idle);
return sone;
}
@@
-563,7
+564,7
@@
public class Core implements IdentityListener {
return;
}
localSones.remove(sone.getId());
return;
}
localSones.remove(sone.getId());
- soneInserters.remove(sone
.getId()
).stop();
+ soneInserters.remove(sone).stop();
}
identityManager.removeContext((OwnIdentity) sone.getIdentity(), "Sone");
}
}
identityManager.removeContext((OwnIdentity) sone.getIdentity(), "Sone");
}