X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=8dcb442e3599af36f69c694360c952456b494a2d;hb=1f597810693fe2af05e821342b83490cd75c2672;hp=3baed89278cde8e756440e097b226282988430ca;hpb=d1b57e7d5f94e621cad3d0b4baaf57901b2084d6;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 3baed89..8dcb442 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -44,11 +44,11 @@ public class Sone { private final String name; /** The URI under which the Sone is stored in Freenet. */ - private final FreenetURI requestUri; + private FreenetURI requestUri; /** The URI used to insert a new version of this Sone. */ /* This will be null for remote Sones! */ - private final FreenetURI insertUri; + private FreenetURI insertUri; /** The profile of this Sone. */ private Profile profile; @@ -307,6 +307,19 @@ public class Sone { this.modificationCounter = modificationCounter; } + /** + * Updates the suggested edition in both the request URI and the insert URI. + * + * @param requestUri + * The request URI that resulted from an insert + */ + public void updateUris(FreenetURI requestUri) { + /* TODO - check for the correct URI. */ + long latestEdition = requestUri.getSuggestedEdition(); + this.requestUri = this.requestUri.setSuggestedEdition(latestEdition); + this.insertUri = this.insertUri.setSuggestedEdition(latestEdition); + } + // // OBJECT METHODS //