X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FFreenetInterface.java;h=20c8da76b488fd57284f097e5a8e9e32985aa8e8;hb=aa94dcb712392b69cb431d1637e4948688d15791;hp=52c2857a6da0a1132aba8cdc3a12a6c757d16c20;hpb=fa63b855e28c5fbf270bfdca1bb23fd048affae5;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 52c2857..20c8da7 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -1,5 +1,5 @@ /* - * FreenetSone - FreenetInterface.java - Copyright © 2010 David Roden + * Sone - FreenetInterface.java - Copyright © 2010 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -153,8 +153,8 @@ public class FreenetInterface { @SuppressWarnings("synthetic-access") public void onFoundEdition(long edition, USK key, ObjectContainer objectContainer, ClientContext clientContext, boolean metadata, short codec, byte[] data, boolean newKnownGood, boolean newSlotToo) { logger.log(Level.FINE, "Found USK update for Sone “%s” at %s, new known good: %s, new slot too: %s.", new Object[] { sone, key, newKnownGood, newSlotToo }); - if (newKnownGood) { - sone.setLatestEdition(key.suggestedEdition); + if (edition > sone.getLatestEdition()) { + sone.setLatestEdition(edition); new Thread(new Runnable() { @Override @@ -176,7 +176,7 @@ public class FreenetInterface { } }; soneUskCallbacks.put(sone.getId(), uskCallback); - node.clientCore.uskManager.subscribe(USK.create(sone.getRequestUri()), uskCallback, true, (HighLevelSimpleClientImpl) client); + node.clientCore.uskManager.subscribe(USK.create(sone.getRequestUri()), uskCallback, (System.currentTimeMillis() - sone.getTime()) < 7 * 24 * 60 * 60 * 1000, (HighLevelSimpleClientImpl) client); } catch (MalformedURLException mue1) { logger.log(Level.WARNING, "Could not subscribe USK “" + sone.getRequestUri() + "”!", mue1); }