Add a core thread that periodically saves the configuration.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / UnfollowSoneAjaxPage.java
index 7e620ef..7f719b7 100644 (file)
@@ -35,7 +35,7 @@ public class UnfollowSoneAjaxPage extends JsonPage {
         *            The Sone web interface
         */
        public UnfollowSoneAjaxPage(WebInterface webInterface) {
-               super("ajax/unfollowSone.ajax", webInterface);
+               super("unfollowSone.ajax", webInterface);
        }
 
        /**
@@ -52,8 +52,8 @@ public class UnfollowSoneAjaxPage extends JsonPage {
                        return createErrorJsonObject("auth-required");
                }
                currentSone.removeFriend(soneId);
-               webInterface.getCore().saveSone(currentSone);
-               return new JsonObject().put("success", true);
+               webInterface.getCore().touchConfiguration();
+               return createSuccessJsonObject();
        }
 
 }