X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=12e700ef33df48551e68f8ddb76f8c0b38c26ffa;hp=c9c6da3798b29ae6214899e6dc116d1c7dec5206;hb=fdbdc26c744865a7200017cb117943d48df498ad;hpb=2402f55b1ae1000a4decbd2833883bebb91952f8 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index c9c6da3..12e700e 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -46,7 +46,6 @@ import net.pterodactylus.sone.core.ConfigurationSoneParser.InvalidPostReplyFound import net.pterodactylus.sone.core.Options.DefaultOption; import net.pterodactylus.sone.core.SoneChangeDetector.PostProcessor; import net.pterodactylus.sone.core.SoneChangeDetector.PostReplyProcessor; -import net.pterodactylus.sone.core.SoneInserter.SetInsertionDelay; import net.pterodactylus.sone.core.event.ImageInsertFinishedEvent; import net.pterodactylus.sone.core.event.MarkPostKnownEvent; import net.pterodactylus.sone.core.event.MarkPostReplyKnownEvent; @@ -129,7 +128,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, private final Options options = new Options(); /** The preferences. */ - private final Preferences preferences = new Preferences(options); + private final Preferences preferences; /** The event bus. */ private final EventBus eventBus; @@ -229,6 +228,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, this.webOfTrustUpdater = webOfTrustUpdater; this.eventBus = eventBus; this.database = database; + preferences = new Preferences(this.eventBus, options); } @VisibleForTesting @@ -243,6 +243,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, this.webOfTrustUpdater = webOfTrustUpdater; this.eventBus = eventBus; this.database = database; + preferences = new Preferences(this.eventBus, options); } // @@ -686,6 +687,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, sone.setKnown(true); /* TODO - load posts ’n stuff */ SoneInserter soneInserter = new SoneInserter(this, eventBus, freenetInterface, ownIdentity.getId()); + eventBus.register(soneInserter); synchronized (soneInserters) { soneInserters.put(sone, soneInserter); } @@ -1718,7 +1720,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, */ private void loadConfiguration() { /* create options. */ - options.addIntegerOption("InsertionDelay", new DefaultOption(60, new IntegerRangePredicate(0, Integer.MAX_VALUE), new SetInsertionDelay())); + options.addIntegerOption("InsertionDelay", new DefaultOption(60, new IntegerRangePredicate(0, Integer.MAX_VALUE))); options.addIntegerOption("PostsPerPage", new DefaultOption(10, new IntegerRangePredicate(1, Integer.MAX_VALUE))); options.addIntegerOption("ImagesPerPage", new DefaultOption(9, new IntegerRangePredicate(1, Integer.MAX_VALUE))); options.addIntegerOption("CharactersPerPost", new DefaultOption(400, Predicates. or(new IntegerRangePredicate(50, Integer.MAX_VALUE), Predicates.equalTo(-1)))); @@ -1727,8 +1729,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, options.addIntegerOption("PositiveTrust", new DefaultOption(75, new IntegerRangePredicate(0, 100))); options.addIntegerOption("NegativeTrust", new DefaultOption(-25, new IntegerRangePredicate(-100, 100))); options.addStringOption("TrustComment", new DefaultOption("Set from Sone Web Interface")); - options.addBooleanOption("ActivateFcpInterface", new DefaultOption(false, fcpInterface.new SetActive())); - options.addIntegerOption("FcpFullAccessRequired", new DefaultOption(2, fcpInterface.new SetFullAccessRequired())); + options.addBooleanOption("ActivateFcpInterface", new DefaultOption(false)); + options.addIntegerOption("FcpFullAccessRequired", new DefaultOption(2)); loadConfigurationValue("InsertionDelay"); loadConfigurationValue("PostsPerPage");