MastoAPI account_view.ex: requested is false when following is true
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 17 May 2019 05:34:52 +0000 (07:34 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 17 May 2019 05:44:09 +0000 (07:44 +0200)
Closes: https://git.pleroma.social/pleroma/pleroma/issues/903
lib/pleroma/web/mastodon_api/views/account_view.ex

index 779b9a3824043aeb690451c68f79f4bd7c061a18..606a0f2ed290281759969d18ed832f6caa40f793 100644 (file)
@@ -40,7 +40,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
     follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target)
 
     requested =
-      if follow_activity do
+      if follow_activity and !User.following?(target, user) do
         follow_activity.data["state"] == "pending"
       else
         false