From: David ‘Bombe’ Roden Date: Thu, 4 Nov 2010 21:43:55 +0000 (+0100) Subject: Download remote Sones first thing after adding them. X-Git-Tag: 0.2-RC1~40 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=549697938ac2e2407183c1db511dfa79f8c059f1;p=Sone.git Download remote Sones first thing after adding them. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 265b8e1..d63b938 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -489,14 +489,23 @@ public class Core implements IdentityListener { return null; } synchronized (remoteSones) { + final Sone sone = getRemoteSone(identity.getId()).setIdentity(identity); if (remoteSones.containsKey(identity.getId())) { logger.log(Level.FINE, "Identity already exists: %s", identity); return remoteSones.get(identity.getId()); } - Sone sone = new Sone(identity); 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; }