From 549697938ac2e2407183c1db511dfa79f8c059f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 4 Nov 2010 22:43:55 +0100 Subject: [PATCH] Download remote Sones first thing after adding them. --- src/main/java/net/pterodactylus/sone/core/Core.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } -- 2.7.4