X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FFollowSonePage.java;h=c71c280ea7cc72ab986289cee80a3d01e6042af7;hb=6db033602e7c17efc40a4a19efe705d67832fc1a;hp=cfa60bb71ca3fb0f181b2c46ea68b61240e1653b;hpb=33e5bcf8dbd32d79dd57d412e33284f2ae3b73c9;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java index cfa60bb..c71c280 100644 --- a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java @@ -50,12 +50,10 @@ public class FollowSonePage extends SoneTemplatePage { super.processTemplate(request, template); if (request.getMethod() == Method.POST) { String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 44); - String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); Sone currentSone = getCurrentSone(request.getToadletContext()); - Sone sone = webInterface.core().getSone(soneId); - if (!sone.equals(currentSone)) { - currentSone.addFriend(sone); - } + currentSone.addFriend(soneId); + webInterface.getCore().saveSone(currentSone); throw new RedirectException(returnPage); } }