From: David ‘Bombe’ Roden Date: Wed, 13 Apr 2011 04:34:48 +0000 (+0200) Subject: Cancel with a ClientContext. X-Git-Tag: beta-freefall-0.6.2-1~14 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6aa4adb3d5660c72b9bea98b8a181f037ab50122;p=Sone.git Cancel with a ClientContext. --- diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index f7fa975..0976dca 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -330,7 +330,7 @@ public class FreenetInterface { * * @author David ‘Bombe’ Roden */ - public static class InsertToken implements ClientPutCallback { + public class InsertToken implements ClientPutCallback { /** The image being inserted. */ private final Image image; @@ -406,8 +406,9 @@ public class FreenetInterface { * * @see ImageInsertListener#imageInsertAborted(Image) */ + @SuppressWarnings("synthetic-access") public void cancel() { - clientPutter.cancel(null, null); + clientPutter.cancel(null, node.clientCore.clientContext); for (ImageInsertListener imageInsertListener : imageInsertListeners) { imageInsertListener.imageInsertAborted(image); } diff --git a/src/main/java/net/pterodactylus/sone/core/ImageInserter.java b/src/main/java/net/pterodactylus/sone/core/ImageInserter.java index 1881902..930fc48 100644 --- a/src/main/java/net/pterodactylus/sone/core/ImageInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/ImageInserter.java @@ -76,7 +76,7 @@ public class ImageInserter { public void insertImage(TemporaryImage temporaryImage, Image image) { Validation.begin().isNotNull("Temporary Image", temporaryImage).isNotNull("Image", image).check().isEqual("Image IDs", image.getId(), temporaryImage.getId()).check(); try { - InsertToken insertToken = new InsertToken(image); + InsertToken insertToken = freenetInterface.new InsertToken(image); insertTokens.put(image.getId(), insertToken); insertToken.addImageInsertListener(core); freenetInterface.insertImage(temporaryImage, image, insertToken);