Convert “image insert finished” into EventBus-based event.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index dfc0b25..9f0e8d9 100644 (file)
@@ -38,6 +38,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.ImageInsertFinishedEvent;
 import net.pterodactylus.sone.core.event.ImageInsertStartedEvent;
 import net.pterodactylus.sone.core.event.MarkPostKnownEvent;
 import net.pterodactylus.sone.core.event.MarkPostReplyKnownEvent;
@@ -1061,20 +1062,23 @@ public class WebInterface implements CoreListener {
                insertingImagesNotification.remove(imageInsertAbortedEvent.image());
        }
 
-       //
-       // CORELISTENER METHODS
-       //
-
        /**
-        * {@inheritDoc}
+        * Notifies the web interface that an {@link Image} insert is finished.
+        *
+        * @param imageInsertFinishedEvent
+        *            The event
         */
-       @Override
-       public void imageInsertFinished(Image image) {
-               insertingImagesNotification.remove(image);
-               insertedImagesNotification.add(image);
+       @Subscribe
+       public void imageInsertFinished(ImageInsertFinishedEvent imageInsertFinishedEvent) {
+               insertingImagesNotification.remove(imageInsertFinishedEvent.image());
+               insertedImagesNotification.add(imageInsertFinishedEvent.image());
                notificationManager.addNotification(insertedImagesNotification);
        }
 
+       //
+       // CORELISTENER METHODS
+       //
+
        /**
         * {@inheritDoc}
         */