X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FUnlikeAjaxPage.java;h=f961bd54c1bbc46b2f240afc08425ef993e2cf81;hb=480691a26222e035e53bda56029524e160fdf898;hp=e5c933dbfaeb497276357f1d72d705bdd3f8369f;hpb=6db033602e7c17efc40a4a19efe705d67832fc1a;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java index e5c933d..f961bd5 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java @@ -1,5 +1,5 @@ /* - * Sone - UnlikeAjaxPage.java - Copyright © 2010 David Roden + * Sone - UnlikeAjaxPage.java - Copyright © 2010–2012 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,6 +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.sone.web.page.FreenetRequest; import net.pterodactylus.util.json.JsonObject; /** @@ -43,7 +44,7 @@ public class UnlikeAjaxPage extends JsonPage { * {@inheritDoc} */ @Override - protected JsonObject createJsonObject(Request request) { + protected JsonObject 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 +56,10 @@ public class UnlikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.removeLikedPostId(id); - webInterface.getCore().saveSone(currentSone); + webInterface.getCore().touchConfiguration(); } else if ("reply".equals(type)) { currentSone.removeLikedReplyId(id); - webInterface.getCore().saveSone(currentSone); + webInterface.getCore().touchConfiguration(); } else { return createErrorJsonObject("invalid-type"); }