Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocke...
authorIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 13 Apr 2020 06:23:50 +0000 (09:23 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 13 Apr 2020 06:23:50 +0000 (09:23 +0300)
# Conflicts:
# lib/pleroma/following_relationship.ex

1  2 
lib/pleroma/following_relationship.ex

index 11e06c5cca7a7d8eb54ba885d089395c5abd0d11,9ccf4049571f4303f8e952874dd4e940572f2eff..219a64352df614c824c705bf922161af04343f23
@@@ -115,16 -105,12 +128,16 @@@ defmodule Pleroma.FollowingRelationshi
      |> Repo.exists?()
    end
  
-     |> where([r], r.state == "accept")
 +  def following_query(%User{} = user) do
 +    __MODULE__
 +    |> join(:inner, [r], u in User, on: r.following_id == u.id)
 +    |> where([r], r.follower_id == ^user.id)
++    |> where([r], r.state == ^:follow_accept)
 +  end
 +
    def following(%User{} = user) do
      following =
 -      __MODULE__
 -      |> join(:inner, [r], u in User, on: r.following_id == u.id)
 -      |> where([r], r.follower_id == ^user.id)
 -      |> where([r], r.state == ^:follow_accept)
 +      following_query(user)
        |> select([r, u], u.follower_address)
        |> Repo.all()