X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FUnfollowSonePage.java;h=481323902345f0b7768d0f24c4261e779e5318df;hb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792;hp=191d9d466e7b22def49f089095d8cee6b0bc7239;hpb=e24e9b763d193832a000bddadc6e7f7c1b0114cd;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java index 191d9d4..4813239 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java @@ -1,5 +1,5 @@ /* - * Sone - UnfollowSonePage.java - Copyright © 2010 David Roden + * Sone - UnfollowSonePage.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +18,10 @@ package net.pterodactylus.sone.web; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.web.page.Page.Request.Method; +import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; +import net.pterodactylus.util.web.Method; /** * This page lets the user unfollow another Sone. @@ -47,16 +48,15 @@ public class UnfollowSonePage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException { + protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException { super.processTemplate(request, templateContext); if (request.getMethod() == Method.POST) { String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); Sone currentSone = getCurrentSone(request.getToadletContext()); String soneIds = request.getHttpRequest().getPartAsStringFailsafe("sone", 2000); for (String soneId : soneIds.split("[ ,]+")) { - currentSone.removeFriend(soneId); + webInterface.getCore().unfollowSone(currentSone, soneId); } - webInterface.getCore().saveSone(currentSone); throw new RedirectException(returnPage); } }