From: David ‘Bombe’ Roden Date: Wed, 17 Nov 2010 21:36:12 +0000 (+0100) Subject: Save Sones after liking stuff. X-Git-Tag: 0.3-RC1~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=70436af0f273c1cc883744ba6b4a15ac080aed98;p=Sone.git Save Sones after liking stuff. --- 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"); }