X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FFollowSonePage.java;h=39e08f37b134c6c279ede87642a2e1740441c528;hb=1d180966fe4bce6bc40cb097782212fb9182506d;hp=2e9f2fef82d0f1d9f7f604a51c5a2d312214692c;hpb=742e80b7603f489795158399f69e19d5aabd524f;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 2e9f2fe..39e08f3 100644 --- a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java @@ -49,9 +49,9 @@ 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()); + if (!(sone instanceof SoneShell) && !sone.equals(currentSone)) { currentSone.addFriendSone(sone); } throw new RedirectException("viewSone.html?sone=" + soneId);