X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FLikeAjaxPage.java;h=f088acb9d23fc08f89ed1da0d8870cd043cd3ebf;hp=efd14399d6c52b62c9025d77860aaf5b5aef37b8;hb=7b55e0be6a3283e43a9bbab98f82aebdd948eb33;hpb=8454806e48890675178c1b4b6cbe4bb9c42b68a3 diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java index efd1439..f088acb 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - LikeAjaxPage.java - Copyright © 2010 David Roden + * Sone - LikeAjaxPage.java - Copyright © 2010–2016 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ package net.pterodactylus.sone.web.ajax; import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.WebInterface; -import net.pterodactylus.util.json.JsonObject; +import net.pterodactylus.sone.web.page.FreenetRequest; /** * AJAX page that lets the user like a {@link Post}. @@ -43,7 +43,7 @@ public class LikeAjaxPage extends JsonPage { * {@inheritDoc} */ @Override - protected JsonObject createJsonObject(Request request) { + protected JsonReturnObject createJsonObject(FreenetRequest request) { String type = request.getHttpRequest().getParam("type", null); String id = request.getHttpRequest().getParam(type, null); if ((id == null) || (id.length() == 0)) { @@ -55,10 +55,10 @@ public class LikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.addLikedPostId(id); - webInterface.getCore().saveSone(currentSone); + webInterface.getCore().touchConfiguration(); } else if ("reply".equals(type)) { currentSone.addLikedReplyId(id); - webInterface.getCore().saveSone(currentSone); + webInterface.getCore().touchConfiguration(); } else { return createErrorJsonObject("invalid-type"); }