From: David ‘Bombe’ Roden Date: Wed, 13 Apr 2011 04:35:17 +0000 (+0200) Subject: Fire appropriate event if cancelled by user. X-Git-Tag: beta-freefall-0.6.2-1~11 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c5d68bd2daefbc5be750cefe3362137d14c7a7d8;p=Sone.git Fire appropriate event if cancelled by user. --- diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 3466ead..90383e1 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -432,7 +432,11 @@ public class FreenetInterface { @Override public void onFailure(InsertException insertException, BaseClientPutter clientPutter, ObjectContainer objectContainer) { for (ImageInsertListener imageInsertListener : imageInsertListeners) { - imageInsertListener.imageInsertFailed(image, insertException); + if ((insertException != null) && ("Cancelled by user".equals(insertException.getMessage()))) { + imageInsertListener.imageInsertAborted(image); + } else { + imageInsertListener.imageInsertFailed(image, insertException); + } } }