From 1d46944fbd17d194d744230cd519d1410e821a47 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 14 Oct 2019 13:50:43 +0700 Subject: [PATCH] Do not add `follower_address` to `following` for non local users --- lib/pleroma/following_relationship.ex | 2 +- test/user_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/following_relationship.ex b/lib/pleroma/following_relationship.ex index 0d789b5a6..2ffac17ee 100644 --- a/lib/pleroma/following_relationship.ex +++ b/lib/pleroma/following_relationship.ex @@ -101,7 +101,7 @@ def following(%User{} = user) 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] diff --git a/test/user_test.exs b/test/user_test.exs index 85e55876d..eb1cf4037 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -243,7 +243,7 @@ test "unfollow with syncronizes external user" 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