Merge branch 'docs/kyclos' into 'develop'
[akkoma] / lib / pleroma / following_relationship.ex
index cc381af53f1e47986d70bdfbe0b272044829edb4..b8cb3bf0372a3960fcbbc484e77956553fcd86ca 100644 (file)
@@ -30,24 +30,9 @@ defmodule Pleroma.FollowingRelationship do
   end
 
   def get(%User{} = follower, %User{} = following) do
-    following_relationship =
-      __MODULE__
-      |> where(follower_id: ^follower.id, following_id: ^following.id)
-      |> Repo.one()
-
-    case {following_relationship, following.local} do
-      {nil, false} ->
-        case Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(follower, following) do
-          %{data: %{"state" => state}} when state in ["pending", "accept"] ->
-            %{state: state}
-
-          _ ->
-            nil
-        end
-
-      {following_relationship, _} ->
-        following_relationship
-    end
+    __MODULE__
+    |> where(follower_id: ^follower.id, following_id: ^following.id)
+    |> Repo.one()
   end
 
   def update(follower, following, "reject"), do: unfollow(follower, following)