From dcf58a3c532d22bc13505b84a50c2c1ddfdaa960 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 9 Dec 2022 20:01:38 +0000 Subject: [PATCH] Do not pass transient undo-y activities through MRF --- CHANGELOG.md | 1 + lib/pleroma/web/activity_pub/mrf.ex | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f266d514..6956912a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/pleroma/web/activity_pub/mrf.ex b/lib/pleroma/web/activity_pub/mrf.ex index 064ffc527..dae6d7f6a 100644 --- a/lib/pleroma/web/activity_pub/mrf.ex +++ b/lib/pleroma/web/activity_pub/mrf.ex @@ -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 -- 2.45.2