From 01d2e31e5687276b5104edc27c3416d4cd9b89b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 4 Nov 2010 22:41:06 +0100 Subject: [PATCH] Save Sone locally after changing friends. --- src/main/java/net/pterodactylus/sone/web/FollowSonePage.java | 1 + src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java | 1 + src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java | 1 + src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java | 1 + 4 files changed, 4 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java index cfa60bb..9fbca9a 100644 --- a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java @@ -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); } diff --git a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java index 5c838a0..d4fd688 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java @@ -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); } diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java index 5b4fdc2..7dc1b24 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/FollowSoneAjaxPage.java @@ -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); } diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java index 012b9cf..e9650aa 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java @@ -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); } -- 2.7.4