X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=9bb9250be831c9a384127defbae0336d71d27413;hp=07f147681d7640cc45b6ed19b649b45b7b16f864;hb=6fd3d46cae8b06225c862a8b5d0a6aef35328e21;hpb=e6768e198b1644393e63947a0fc45f1c72ae474b diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 07f1476..9bb9250 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -38,7 +38,6 @@ import javax.inject.Named; import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.ElementLoader; import net.pterodactylus.sone.core.event.*; -import net.pterodactylus.sone.data.Image; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Sone; @@ -174,15 +173,6 @@ public class WebInterface implements SessionProvider { /** Notifications for sone inserts. */ private final Map soneInsertNotifications = new HashMap<>(); - /** The “inserting images” notification. */ - private final ListNotification insertingImagesNotification; - - /** The “inserted images” notification. */ - private final ListNotification insertedImagesNotification; - - /** The “image insert failed” notification. */ - private final ListNotification imageInsertFailedNotification; - /** Scheduled executor for time-based notifications. */ private final ScheduledExecutorService ticker = Executors.newScheduledThreadPool(1); @@ -231,15 +221,6 @@ public class WebInterface implements SessionProvider { Template mentionNotificationTemplate = loaders.loadTemplate("/templates/notify/mentionNotification.html"); mentionNotification = new ListNotification<>("mention-notification", "posts", mentionNotificationTemplate, false); - - Template insertingImagesTemplate = loaders.loadTemplate("/templates/notify/inserting-images-notification.html"); - insertingImagesNotification = new ListNotification<>("inserting-images-notification", "images", insertingImagesTemplate); - - Template insertedImagesTemplate = loaders.loadTemplate("/templates/notify/inserted-images-notification.html"); - insertedImagesNotification = new ListNotification<>("inserted-images-notification", "images", insertedImagesTemplate); - - Template imageInsertFailedTemplate = loaders.loadTemplate("/templates/notify/image-insert-failed-notification.html"); - imageInsertFailedNotification = new ListNotification<>("image-insert-failed-notification", "images", imageInsertFailedTemplate); } // @@ -780,55 +761,6 @@ public class WebInterface implements SessionProvider { } } - /** - * Notifies the web interface that an image insert was started - * - * @param imageInsertStartedEvent - * The event - */ - @Subscribe - public void imageInsertStarted(ImageInsertStartedEvent imageInsertStartedEvent) { - insertingImagesNotification.add(imageInsertStartedEvent.getImage()); - notificationManager.addNotification(insertingImagesNotification); - } - - /** - * Notifies the web interface that an {@link Image} insert was aborted. - * - * @param imageInsertAbortedEvent - * The event - */ - @Subscribe - public void imageInsertAborted(ImageInsertAbortedEvent imageInsertAbortedEvent) { - insertingImagesNotification.remove(imageInsertAbortedEvent.getImage()); - } - - /** - * Notifies the web interface that an {@link Image} insert is finished. - * - * @param imageInsertFinishedEvent - * The event - */ - @Subscribe - public void imageInsertFinished(ImageInsertFinishedEvent imageInsertFinishedEvent) { - insertingImagesNotification.remove(imageInsertFinishedEvent.getImage()); - insertedImagesNotification.add(imageInsertFinishedEvent.getImage()); - notificationManager.addNotification(insertedImagesNotification); - } - - /** - * Notifies the web interface that an {@link Image} insert has failed. - * - * @param imageInsertFailedEvent - * The event - */ - @Subscribe - public void imageInsertFailed(ImageInsertFailedEvent imageInsertFailedEvent) { - insertingImagesNotification.remove(imageInsertFailedEvent.getImage()); - imageInsertFailedNotification.add(imageInsertFailedEvent.getImage()); - notificationManager.addNotification(imageInsertFailedNotification); - } - @Subscribe public void debugActivated(@Nonnull DebugActivatedEvent debugActivatedEvent) { pageToadletRegistry.activateDebugMode();