From: Ivan Tashkinov Date: Mon, 13 Apr 2020 06:23:50 +0000 (+0300) Subject: Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocke... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f00ff20768cbbb6eb5a6442772335dbe60fde6d4;p=akkoma Merge remote-tracking branch 'remotes/origin/develop' into 1364-no-pushes-from-blocked-domains-users # Conflicts: # lib/pleroma/following_relationship.ex --- f00ff20768cbbb6eb5a6442772335dbe60fde6d4 diff --cc lib/pleroma/following_relationship.ex index 11e06c5cc,9ccf40495..219a64352 --- a/lib/pleroma/following_relationship.ex +++ b/lib/pleroma/following_relationship.ex @@@ -115,16 -105,12 +128,16 @@@ defmodule Pleroma.FollowingRelationshi |> Repo.exists?() end + 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 == "accept") ++ |> 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()