Do not add `follower_address` to `following` for non local users
authorEgor Kislitsyn <egor@kislitsyn.com>
Mon, 14 Oct 2019 06:50:43 +0000 (13:50 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Mon, 14 Oct 2019 06:50:43 +0000 (13:50 +0700)
lib/pleroma/following_relationship.ex
test/user_test.exs

index 0d789b5a668f28c2f19848f65d6a4a71c1a2ef68..2ffac17ee135667774c0cd64f110d6425fc81706 100644 (file)
@@ -101,7 +101,7 @@ defmodule Pleroma.FollowingRelationship do
       |> select([r, u], u.follower_address)
       |> Repo.all()
 
-    if user.nickname in [nil, "internal.fetch"] do
+    if not user.local or user.nickname in [nil, "internal.fetch"] do
       following
     else
       [user.follower_address | following]
index 85e55876d5539e46507e8fc295b312dd08562d73..eb1cf4037f1553e102926e8e183fa55fe7e002d7 100644 (file)
@@ -243,7 +243,7 @@ defmodule Pleroma.UserTest do
 
       user = User.get_cached_by_id(user.id)
 
-      assert User.following(user) == [user.follower_address]
+      assert User.following(user) == []
     end
 
     test "unfollow takes a user and another user" do