Save Sone locally after changing friends.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 21:41:06 +0000 (22:41 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 21:41:06 +0000 (22:41 +0100)
src/main/java/net/pterodactylus/sone/web/FollowSonePage.java
src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java
src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java

index cfa60bb..9fbca9a 100644 (file)
@@ -55,6 +55,7 @@ public class FollowSonePage extends SoneTemplatePage {
                        Sone sone = webInterface.core().getSone(soneId);
                        if (!sone.equals(currentSone)) {
                                currentSone.addFriend(sone);
+                               webInterface.core().saveSone(currentSone);
                        }
                        throw new RedirectException(returnPage);
                }
index 5c838a0..d4fd688 100644 (file)
@@ -55,6 +55,7 @@ public class UnfollowSonePage extends SoneTemplatePage {
                        Sone sone = webInterface.core().getSone(soneId);
                        if (!sone.equals(currentSone)) {
                                currentSone.removeFriend(sone);
+                               webInterface.core().saveSone(currentSone);
                        }
                        throw new RedirectException(returnPage);
                }
index 5b4fdc2..7dc1b24 100644 (file)
@@ -53,6 +53,7 @@ public class FollowSoneAjaxPage extends JsonPage {
                        return new JsonObject().put("success", false).put("error", "auth-required");
                }
                currentSone.addFriend(sone);
+               webInterface.core().saveSone(currentSone);
                return new JsonObject().put("success", true);
        }
 
index 012b9cf..e9650aa 100644 (file)
@@ -53,6 +53,7 @@ public class UnfollowSoneAjaxPage extends JsonPage {
                        return new JsonObject().put("success", false).put("error", "auth-required");
                }
                currentSone.removeFriend(sone);
+               webInterface.core().saveSone(currentSone);
                return new JsonObject().put("success", true);
        }