Rename “friend Sone” to just “friend.”
[Sone.git] / src / main / java / net / pterodactylus / sone / web / FollowSonePage.java
index 2e9f2fe..ba55e23 100644 (file)
@@ -49,10 +49,10 @@ public class FollowSonePage extends SoneTemplatePage {
        protected void processTemplate(Request request, Template template) throws RedirectException {
                super.processTemplate(request, template);
                String soneId = request.getHttpRequest().getParam("sone");
+               Sone currentSone = getCurrentSone(request.getToadletContext());
                Sone sone = webInterface.core().getSone(soneId);
-               if (!(sone instanceof SoneShell)) {
-                       Sone currentSone = getCurrentSone(request.getToadletContext());
-                       currentSone.addFriendSone(sone);
+               if (!(sone instanceof SoneShell) && !sone.equals(currentSone)) {
+                       currentSone.addFriend(sone);
                }
                throw new RedirectException("viewSone.html?sone=" + soneId);
        }