X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FFollowSonePage.java;h=81225e92d778c1397f9185b503d72cd5fce16c84;hp=9cd1f2afb7ab608158fbb98aeb9cac6339257cf4;hb=89a905395984ec35e313b07594e21773ffd3d9d8;hpb=13e00a0611cd80e43f813171d8b6d84870afbcbc diff --git a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java index 9cd1f2a..81225e9 100644 --- a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java @@ -50,11 +50,13 @@ public class FollowSonePage extends SoneTemplatePage { protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); if (request.getMethod() == Method.POST) { - String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 44); String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); Sone currentSone = getCurrentSone(request.getToadletContext()); - currentSone.addFriend(soneId); - webInterface.getCore().saveSone(currentSone); + String soneIds = request.getHttpRequest().getPartAsStringFailsafe("sone", 1200); + for (String soneId : soneIds.split("[ ,]+")) { + currentSone.addFriend(soneId); + } + webInterface.getCore().touchConfiguration(); throw new RedirectException(returnPage); } }