Better checking of previous follow request attempts
authorMark Felder <feld@feld.me>
Fri, 19 Feb 2021 20:42:20 +0000 (14:42 -0600)
committerMark Felder <feld@feld.me>
Tue, 30 Mar 2021 16:10:44 +0000 (11:10 -0500)
lib/pleroma/web/activity_pub/mrf/follow_bot_policy.ex

index 2fd5d5612e8f3adf1fc4e3d5862aa49cc460bc85..c7aaa6386ecddd83ac26ba99718db44ba147342f 100644 (file)
@@ -65,7 +65,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.FollowBotPolicy do
     |> Queries.by_object_id()
     |> Queries.by_type("Follow")
     |> where([a], a.inserted_at > ^since_datetime)
-    |> where([a], fragment("? ->> 'state' = 'pending'", a.data))
+    |> where([a], fragment("? ->> 'state' != 'accept'", a.data))
     |> where([a], a.actor == ^follower_id)
     |> Repo.exists?()
   end