From: David ‘Bombe’ Roden Date: Thu, 4 Nov 2010 21:41:06 +0000 (+0100) Subject: Save Sone locally after changing friends. X-Git-Tag: 0.2-RC1~46 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=01d2e31e5687276b5104edc27c3416d4cd9b89b8;p=Sone.git Save Sone locally after changing friends. --- 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); }