Convert “image insert aborted” into EventBus-based event.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index a30508e..dfc0b25 100644 (file)
@@ -37,6 +37,7 @@ import java.util.logging.Logger;
 
 import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.core.CoreListener;
+import net.pterodactylus.sone.core.event.ImageInsertAbortedEvent;
 import net.pterodactylus.sone.core.event.ImageInsertStartedEvent;
 import net.pterodactylus.sone.core.event.MarkPostKnownEvent;
 import net.pterodactylus.sone.core.event.MarkPostReplyKnownEvent;
@@ -1049,18 +1050,21 @@ public class WebInterface implements CoreListener {
                notificationManager.addNotification(insertingImagesNotification);
        }
 
-       //
-       // CORELISTENER METHODS
-       //
-
        /**
-        * {@inheritDoc}
+        * Notifies the web interface that an {@link Image} insert was aborted.
+        *
+        * @param imageInsertAbortedEvent
+        *            The event
         */
-       @Override
-       public void imageInsertAborted(Image image) {
-               insertingImagesNotification.remove(image);
+       @Subscribe
+       public void imageInsertAborted(ImageInsertAbortedEvent imageInsertAbortedEvent) {
+               insertingImagesNotification.remove(imageInsertAbortedEvent.image());
        }
 
+       //
+       // CORELISTENER METHODS
+       //
+
        /**
         * {@inheritDoc}
         */