Watch Sone for updates after it has been downloaded.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index ccd5aff..b2aa43d 100644 (file)
@@ -310,8 +310,10 @@ public class Core extends AbstractService {
         */
        public void loadSone(String requestUri) {
                try {
-                       FetchResult fetchResult = freenetInterface.fetchUri(new FreenetURI(requestUri).setMetaString(new String[] { "sone.xml" }));
-                       soneDownloader.parseSone(null, fetchResult);
+                       FreenetURI realRequestUri = new FreenetURI(requestUri).setMetaString(new String[] { "sone.xml" });
+                       FetchResult fetchResult = freenetInterface.fetchUri(realRequestUri);
+                       Sone parsedSone = soneDownloader.parseSone(null, fetchResult, realRequestUri);
+                       addSone(parsedSone);
                } catch (MalformedURLException mue1) {
                        logger.log(Level.INFO, "Could not create URI from “" + requestUri + "”.", mue1);
                }