Fix MRF policies to also work with Update
[akkoma] / lib / pleroma / web / activity_pub / mrf / force_bot_unlisted_policy.ex
index 51dbb1ad446cfd63e796ddb1ece2766e9b3e8c08..fa6b93333c75c9c45ba5f1b28b038647fcf2a6ca 100644 (file)
@@ -4,7 +4,7 @@
 
 defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy do
   alias Pleroma.User
-  @behaviour Pleroma.Web.ActivityPub.MRF
+  @behaviour Pleroma.Web.ActivityPub.MRF.Policy
   @moduledoc "Remove bot posts from federated timeline"
 
   require Pleroma.Constants
@@ -17,13 +17,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy do
   @impl true
   def filter(
         %{
-          "type" => "Create",
+          "type" => type,
           "to" => to,
           "cc" => cc,
           "actor" => actor,
           "object" => object
         } = message
-      ) do
+      )
+      when type in ["Create", "Update"] do
     user = User.get_cached_by_ap_id(actor)
     isbot = check_if_bot(user)