Use local Sone in Sone inserter.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneInserter.java
index 33bc240..5ae2f73 100644 (file)
@@ -39,6 +39,7 @@ import net.pterodactylus.sone.core.event.SoneInsertAbortedEvent;
 import net.pterodactylus.sone.core.event.SoneInsertedEvent;
 import net.pterodactylus.sone.core.event.SoneInsertingEvent;
 import net.pterodactylus.sone.data.Album;
+import net.pterodactylus.sone.data.LocalSone;
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.Reply;
 import net.pterodactylus.sone.data.Sone;
@@ -120,7 +121,7 @@ public class SoneInserter extends AbstractService {
                this(core, eventBus, freenetInterface, soneId, new SoneModificationDetector(new LockableFingerprintProvider() {
                        @Override
                        public boolean isLocked() {
-                               final Optional<Sone> sone = core.getSone(soneId);
+                               final Optional<LocalSone> sone = core.getLocalSone(soneId);
                                if (!sone.isPresent()) {
                                        return false;
                                }
@@ -214,12 +215,12 @@ public class SoneInserter extends AbstractService {
                                sleep(delay);
 
                                if (soneModificationDetector.isEligibleForInsert()) {
-                                       Optional<Sone> soneOptional = core.getSone(soneId);
+                                       Optional<LocalSone> soneOptional = core.getLocalSone(soneId);
                                        if (!soneOptional.isPresent()) {
                                                logger.log(Level.WARNING, format("Sone %s has disappeared, exiting inserter.", soneId));
                                                return;
                                        }
-                                       Sone sone = soneOptional.get();
+                                       LocalSone sone = soneOptional.get();
                                        InsertInformation insertInformation = new InsertInformation(sone);
                                        logger.log(Level.INFO, String.format("Inserting Sone ā€œ%sā€ā€¦", sone.getName()));