X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=0e7905db71e4663e23777c6e51ca9d61778f7c89;hp=dc09d78cfe85a10d7e4ab4d2afe6bdf038548c85;hb=03b402bcc630ed09db52f9c16ec9950e01255a71;hpb=8ba12e622791bf6459d3614ac5d86436f9b409c5 diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index dc09d78..0e7905d 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -70,6 +70,7 @@ import net.pterodactylus.sone.web.page.PageToadlet; import net.pterodactylus.sone.web.page.PageToadletFactory; import net.pterodactylus.sone.web.page.StaticPage; import net.pterodactylus.util.logging.Logging; +import net.pterodactylus.util.notify.Notification; import net.pterodactylus.util.notify.NotificationManager; import net.pterodactylus.util.notify.TemplateNotification; import net.pterodactylus.util.template.DateFilter; @@ -244,6 +245,22 @@ public class WebInterface implements CoreListener { return new HashSet(newReplyNotification.getElements()); } + /** + * Sets whether the current start of the plugin is the first start. It is + * considered a first start if the configuration file does not exist. + * + * @param firstStart + * {@code true} if no configuration file existed when Sone was + * loaded, {@code false} otherwise + */ + public void setFirstStart(boolean firstStart) { + if (firstStart) { + Template firstStartNotificationTemplate = new Template(createReader("/templates/notify/firstStartNotification.html")); + Notification firstStartNotification = new TemplateNotification("first-start-notification", firstStartNotificationTemplate); + notificationManager.addNotification(firstStartNotification); + } + } + // // ACTIONS //