X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FOptionsPage.java;h=fda6afd0a9c6e1c5df20de79991c7c4a490abd0c;hb=c46e41b7c377a96d77ec95948b7a4d8333daa275;hp=4f76fda25397ead450a0f0d19e5b7594fa3d4fb2;hpb=154ebe9fb816972d081a328ff06c168c2a3912b9;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java index 4f76fda..fda6afd 100644 --- a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java +++ b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java @@ -64,7 +64,9 @@ public class OptionsPage extends SoneTemplatePage { if (currentSone != null) { boolean autoFollow = request.getHttpRequest().isPartSet("auto-follow"); currentSone.getOptions().getBooleanOption("AutoFollow").set(autoFollow); - webInterface.getCore().saveSone(currentSone); + boolean enableSoneInsertNotifications = request.getHttpRequest().isPartSet("enable-sone-insert-notifications"); + currentSone.getOptions().getBooleanOption("EnableSoneInsertNotifications").set(enableSoneInsertNotifications); + webInterface.getCore().touchConfiguration(); } Integer insertionDelay = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("insertion-delay", 16)); if (!preferences.validateInsertionDelay(insertionDelay)) { @@ -108,13 +110,11 @@ public class OptionsPage extends SoneTemplatePage { Integer fcpFullAccessRequiredInteger = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("fcp-full-access-required", 1), preferences.getFcpFullAccessRequired().ordinal()); FullAccessRequired fcpFullAccessRequired = FullAccessRequired.values()[fcpFullAccessRequiredInteger]; preferences.setFcpFullAccessRequired(fcpFullAccessRequired); - boolean soneRescueMode = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("sone-rescue-mode", 5)); - preferences.setSoneRescueMode(soneRescueMode); boolean clearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("clear-on-next-restart", 5)); preferences.setClearOnNextRestart(clearOnNextRestart); boolean reallyClearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("really-clear-on-next-restart", 5)); preferences.setReallyClearOnNextRestart(reallyClearOnNextRestart); - webInterface.getCore().saveConfiguration(); + webInterface.getCore().touchConfiguration(); if (fieldErrors.isEmpty()) { throw new RedirectException(getPath()); } @@ -122,6 +122,7 @@ public class OptionsPage extends SoneTemplatePage { } if (currentSone != null) { templateContext.set("auto-follow", currentSone.getOptions().getBooleanOption("AutoFollow").get()); + templateContext.set("enable-sone-insert-notifications", currentSone.getOptions().getBooleanOption("EnableSoneInsertNotifications").get()); } templateContext.set("insertion-delay", preferences.getInsertionDelay()); templateContext.set("posts-per-page", preferences.getPostsPerPage()); @@ -132,7 +133,6 @@ public class OptionsPage extends SoneTemplatePage { templateContext.set("trust-comment", preferences.getTrustComment()); templateContext.set("fcp-interface-active", preferences.isFcpInterfaceActive()); templateContext.set("fcp-full-access-required", preferences.getFcpFullAccessRequired().ordinal()); - templateContext.set("sone-rescue-mode", preferences.isSoneRescueMode()); templateContext.set("clear-on-next-restart", preferences.isClearOnNextRestart()); templateContext.set("really-clear-on-next-restart", preferences.isReallyClearOnNextRestart()); }