Increase the possible length of “returnPage” because 64 is too short.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / UnfollowSonePage.java
index 7b7c7eb..5b0c652 100644 (file)
@@ -50,13 +50,10 @@ public class UnfollowSonePage 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.getCore().getSone(soneId);
-                       if (!sone.equals(currentSone)) {
-                               currentSone.removeFriend(sone);
-                               webInterface.getCore().saveSone(currentSone);
-                       }
+                       currentSone.removeFriend(soneId);
+                       webInterface.getCore().saveSone(currentSone);
                        throw new RedirectException(returnPage);
                }
        }