From 70436af0f273c1cc883744ba6b4a15ac080aed98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 17 Nov 2010 22:36:12 +0100 Subject: [PATCH] Save Sones after liking stuff. --- src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java | 2 ++ src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java | 2 ++ 2 files changed, 4 insertions(+) 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 1a49ccd..17438d4 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java @@ -55,8 +55,10 @@ public class LikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.addLikedPostId(id); + webInterface.getCore().saveSone(currentSone); } else if ("reply".equals(type)) { currentSone.addLikedReplyId(id); + webInterface.getCore().saveSone(currentSone); } else { return createErrorJsonObject("invalid-type"); } 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 6a4dde7..fb0445b 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java @@ -55,8 +55,10 @@ public class UnlikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.removeLikedPostId(id); + webInterface.getCore().saveSone(currentSone); } else if ("reply".equals(type)) { currentSone.removeLikedReplyId(id); + webInterface.getCore().saveSone(currentSone); } else { return createErrorJsonObject("invalid-type"); } -- 2.7.4