From: David ‘Bombe’ Roden Date: Fri, 11 Oct 2013 06:22:03 +0000 (+0200) Subject: Copy insert URI of original Sone when parsing a new Sone. X-Git-Tag: 0.8.8^2~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ed8f6544d087c83875f160caa72b8434132ad526;p=Sone.git Copy insert URI of original Sone when parsing a new Sone. This, once again, fixes the Rescue Mode. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index cffc8d9..53eef16 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -308,16 +308,8 @@ public class SoneDownloader extends AbstractService { } } - String soneInsertUri = soneXml.getValue("insert-uri", null); - if ((soneInsertUri != null) && (sone.getInsertUri() == null)) { - try { - sone.setInsertUri(new FreenetURI(soneInsertUri)); - sone.setLatestEdition(Math.max(sone.getRequestUri().getEdition(), sone.getInsertUri().getEdition())); - } catch (MalformedURLException mue1) { - /* TODO - mark Sone as bad. */ - logger.log(Level.WARNING, String.format("Downloaded Sone %s has invalid insert URI: %s", sone, soneInsertUri), mue1); - return null; - } + if (originalSone.getInsertUri() != null) { + sone.setInsertUri(originalSone.getInsertUri()); } SimpleXML profileXml = soneXml.getNode("profile");