Do not pass transient undo-y activities through MRF
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Fri, 9 Dec 2022 20:01:38 +0000 (20:01 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Fri, 9 Dec 2022 20:01:38 +0000 (20:01 +0000)
CHANGELOG.md
lib/pleroma/web/activity_pub/mrf.ex

index 4f266d51437e551bdbead816e58dcc8ef60ac2d7..6956912a7ece44cbdcd13faf318b9005f25fbf57 100644 (file)
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
 ## Removed
 - FollowBotPolicy
+- Passing of undo/block into MRF
 
 ## Upgrade Notes
 - If you have an old instance, you will probably want to run `mix pleroma.database prune_task` in the foreground to catch it up with the history of your instance.
index 064ffc527adef1b085a334255ad3897b32b8f2e5..dae6d7f6a1ae74512336d46f2efd5e98fc6779f3 100644 (file)
@@ -63,6 +63,12 @@ defmodule Pleroma.Web.ActivityPub.MRF do
 
   @required_description_keys [:key, :related_policy]
 
+  def filter_one(policy, %{"type" => type} = message)
+      when type in ["Undo", "Block", "Delete"] and
+             policy != Pleroma.Web.ActivityPub.MRF.SimplePolicy do
+    {:ok, message}
+  end
+
   def filter_one(policy, message) do
     should_plug_history? =
       if function_exported?(policy, :history_awareness, 0) do