Set insertion delay on every created inserter
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 14 Nov 2017 20:43:04 +0000 (21:43 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 14 Nov 2017 20:43:04 +0000 (21:43 +0100)
This will fix the problem Debora_Wöpcke reported in
post://49fad115-effe-42dd-bb1f-d3e661d0a26a

src/main/java/net/pterodactylus/sone/core/Core.java

index 2746d7b..6292934 100644 (file)
@@ -51,6 +51,7 @@ import net.pterodactylus.sone.core.ConfigurationSoneParser.InvalidPostReplyFound
 import net.pterodactylus.sone.core.SoneChangeDetector.PostProcessor;
 import net.pterodactylus.sone.core.SoneChangeDetector.PostReplyProcessor;
 import net.pterodactylus.sone.core.event.ImageInsertFinishedEvent;
+import net.pterodactylus.sone.core.event.InsertionDelayChangedEvent;
 import net.pterodactylus.sone.core.event.MarkPostKnownEvent;
 import net.pterodactylus.sone.core.event.MarkPostReplyKnownEvent;
 import net.pterodactylus.sone.core.event.MarkSoneKnownEvent;
@@ -654,6 +655,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                sone.setClient(new Client("Sone", SonePlugin.getPluginVersion()));
                sone.setKnown(true);
                SoneInserter soneInserter = new SoneInserter(this, eventBus, freenetInterface, ownIdentity.getId());
+               soneInserter.insertionDelayChanged(new InsertionDelayChangedEvent(preferences.getInsertionDelay()));
                eventBus.register(soneInserter);
                synchronized (soneInserters) {
                        soneInserters.put(sone, soneInserter);