Don’t run background fetchers for Sones that are last updated more than 7 days ago.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneDownloader.java
index c883301..177b462 100644 (file)
@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import net.pterodactylus.sone.core.Core.Preferences;
 import net.pterodactylus.sone.core.Core.SoneStatus;
 import net.pterodactylus.sone.data.Client;
 import net.pterodactylus.sone.data.Post;
@@ -93,6 +94,7 @@ public class SoneDownloader extends AbstractService {
         */
        public void addSone(Sone sone) {
                if (sones.add(sone)) {
+                       freenetInterface.unregisterUsk(sone);
                        freenetInterface.registerUsk(sone, this);
                }
        }
@@ -122,8 +124,8 @@ public class SoneDownloader extends AbstractService {
 
        /**
         * Fetches the updated Sone. This method can be used to fetch a Sone from a
-        * specific URI (which happens when {@link Core#isSoneRescueMode() „Sone
-        * rescue mode“} is active).
+        * specific URI (which happens when {@link Preferences#isSoneRescueMode()
+        * „Sone rescue mode“} is active).
         *
         * @param sone
         *            The Sone to fetch