Don’t set friends directly, use Core’s follow() methods.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / FollowSoneAjaxPage.java
index 5c3e5f4..764fa28 100644 (file)
@@ -52,8 +52,8 @@ public class FollowSoneAjaxPage extends JsonPage {
                if (currentSone == null) {
                        return createErrorJsonObject("auth-required");
                }
-               currentSone.addFriend(soneId);
-               webInterface.getCore().touchConfiguration();
+               webInterface.getCore().followSone(currentSone, soneId);
+               webInterface.getCore().markSoneKnown(webInterface.getCore().getSone(soneId));
                return createSuccessJsonObject();
        }