Start the Sone downloader, otherwise it can not be stopped on shutdown.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 3164484..594a4ac 100644 (file)
@@ -107,6 +107,7 @@ public class Core extends AbstractService {
        public Core freenetInterface(FreenetInterface freenetInterface) {
                this.freenetInterface = freenetInterface;
                soneDownloader = new SoneDownloader(freenetInterface);
+               soneDownloader.start();
                return this;
        }
 
@@ -336,7 +337,7 @@ public class Core extends AbstractService {
                                        if (friendId == null) {
                                                break;
                                        }
-                                       Sone friendSone = soneCache.get(friendId);
+                                       Sone friendSone = getSone(friendId);
                                        String friendKey = configuration.getStringValue(friendPrefix + "/Key").getValue(null);
                                        String friendName = configuration.getStringValue(friendPrefix + "/Name").getValue(null);
                                        friendSone.setRequestUri(new FreenetURI(friendKey)).setName(friendName);