Create trust updater and store it in the core.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 4001f46..4b79c3f 100644 (file)
@@ -112,6 +112,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        /** The update checker. */
        private final UpdateChecker updateChecker;
 
+       /** The trust updater. */
+       private final TrustUpdater trustUpdater;
+
        /** The FCP interface. */
        private volatile FcpInterface fcpInterface;
 
@@ -185,7 +188,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         * @param identityManager
         *            The identity manager
         */
-       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager) {
+       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, TrustUpdater trustUpdater) {
                super("Sone Core");
                this.configuration = configuration;
                this.freenetInterface = freenetInterface;
@@ -193,6 +196,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                this.soneDownloader = new SoneDownloader(this, freenetInterface);
                this.imageInserter = new ImageInserter(this, freenetInterface);
                this.updateChecker = new UpdateChecker(freenetInterface);
+               this.trustUpdater = trustUpdater;
        }
 
        //
@@ -1967,6 +1971,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                loadConfiguration();
                updateChecker.addUpdateListener(this);
                updateChecker.start();
+               trustUpdater.start();
        }
 
        /**
@@ -1999,6 +2004,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                soneInserter.stop();
                        }
                }
+               trustUpdater.stop();
                updateChecker.stop();
                updateChecker.removeUpdateListener(this);
                soneDownloader.stop();