Use dependency injection for SoneDownloader
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 1 Feb 2018 18:42:36 +0000 (19:42 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 1 Feb 2018 19:33:44 +0000 (20:33 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 7384eda..04f7181 100644 (file)
@@ -208,12 +208,12 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         *            The database
         */
        @Inject
-       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, UpdateChecker updateChecker, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus, Database database) {
+       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, SoneDownloader soneDownloader, UpdateChecker updateChecker, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus, Database database) {
                super("Sone Core");
                this.configuration = configuration;
                this.freenetInterface = freenetInterface;
                this.identityManager = identityManager;
-               this.soneDownloader = new SoneDownloaderImpl(this, freenetInterface);
+               this.soneDownloader = soneDownloader;
                this.imageInserter = new ImageInserter(freenetInterface, freenetInterface.new InsertTokenSupplier());
                this.updateChecker = updateChecker;
                this.webOfTrustUpdater = webOfTrustUpdater;