X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=1c58bd39ae069c25848a76b40473f4aab677b895;hp=886383cad77b5f5e20443010cb27843e0522705f;hb=f35aa413bce1d18c6f822719f7864ea6838cd043;hpb=91cc17cf993ae2cb01864e48cf28a15afa2dc11e diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 886383c..1c58bd3 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -45,6 +45,7 @@ import net.pterodactylus.sone.core.event.NewPostReplyFoundEvent; import net.pterodactylus.sone.core.event.NewSoneFoundEvent; import net.pterodactylus.sone.core.event.PostRemovedEvent; import net.pterodactylus.sone.core.event.PostReplyRemovedEvent; +import net.pterodactylus.sone.core.event.SoneInsertedEvent; import net.pterodactylus.sone.core.event.SoneInsertingEvent; import net.pterodactylus.sone.core.event.SoneLockedEvent; import net.pterodactylus.sone.core.event.SoneRemovedEvent; @@ -988,23 +989,26 @@ public class WebInterface implements CoreListener { } } - // - // CORELISTENER METHODS - // - /** - * {@inheritDoc} + * Notifies the web interface that a {@link Sone} was inserted. + * + * @param soneInsertedEvent + * The event */ - @Override - public void soneInserted(Sone sone, long insertDuration) { - TemplateNotification soneInsertNotification = getSoneInsertNotification(sone); + @Subscribe + public void soneInserted(SoneInsertedEvent soneInsertedEvent) { + TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertedEvent.sone()); soneInsertNotification.set("soneStatus", "inserted"); - soneInsertNotification.set("insertDuration", insertDuration / 1000); - if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) { + soneInsertNotification.set("insertDuration", soneInsertedEvent.insertDuration() / 1000); + if (soneInsertedEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) { notificationManager.addNotification(soneInsertNotification); } } + // + // CORELISTENER METHODS + // + /** * {@inheritDoc} */