Save Sones after liking stuff.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 21:36:12 +0000 (22:36 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 21:36:12 +0000 (22:36 +0100)
src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java
src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java

index 1a49ccd..17438d4 100644 (file)
@@ -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");
                }
index 6a4dde7..fb0445b 100644 (file)
@@ -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");
                }