X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=054ed533ffcead2e26cd71771510df3c1e3ab54a;hp=0e62f77042b3d565e050f8de01ab68f79e009f5b;hb=1c9f64a1a1aa8098596cc4c092d1074b52f63b60;hpb=030cf808626f4adba9976dbc8da3caee6fe60293 diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 0e62f77..054ed53 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -866,7 +866,9 @@ public class WebInterface implements CoreListener { public void soneInserting(Sone sone) { TemplateNotification soneInsertNotification = getSoneInsertNotification(sone); soneInsertNotification.set("soneStatus", "inserting"); - notificationManager.addNotification(soneInsertNotification); + if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) { + notificationManager.addNotification(soneInsertNotification); + } } /** @@ -877,7 +879,9 @@ public class WebInterface implements CoreListener { TemplateNotification soneInsertNotification = getSoneInsertNotification(sone); soneInsertNotification.set("soneStatus", "inserted"); soneInsertNotification.set("insertDuration", insertDuration / 1000); - notificationManager.addNotification(soneInsertNotification); + if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) { + notificationManager.addNotification(soneInsertNotification); + } } /** @@ -885,7 +889,12 @@ public class WebInterface implements CoreListener { */ @Override public void soneInsertAborted(Sone sone, Throwable cause) { - notificationManager.addNotification(getSoneInsertNotification(sone).set("soneStatus", "insert-aborted").set("insert-error", cause)); + TemplateNotification soneInsertNotification = getSoneInsertNotification(sone); + soneInsertNotification.set("soneStatus", "insert-aborted"); + soneInsertNotification.set("insert-error", cause); + if (sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) { + notificationManager.addNotification(soneInsertNotification); + } } /**