diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 0e06df8418..e663b41956 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1426,6 +1426,7 @@ def get_friends_ids(%User{} = user, page \\ nil) do def get_familiar_followers_query(%User{} = user, %User{} = current_user, nil) do friends = get_friends_query(current_user) + |> where([u], not u.hide_follows) |> select([u], u.id) User.Query.build(%{is_active: true}) diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index 750819f8ba..d57178a34c 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -2229,7 +2229,7 @@ test "max pinned accounts", %{user: user, conn: conn} do setup do: oauth_access(["read:follows"]) test "fetch user familiar followers", %{user: user, conn: conn} do - other_user1 = insert(:user) + %{id: id1} = other_user1 = insert(:user) %{id: id2} = other_user2 = insert(:user) _ = insert(:user) @@ -2259,7 +2259,7 @@ test "returns empty array if followers are hidden", %{user: user, conn: conn} do end test "it respects hide_followers", %{user: user, conn: conn} do - %{id: id1} = other_user1 = insert(:user) + other_user1 = insert(:user) %{id: id2} = other_user2 = insert(:user, hide_followers: true) _ = insert(:user)