From 7adead8df8e8d58cb785f7cd57def41d56bc2b4b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 21 May 2023 16:12:33 -0500 Subject: [PATCH] AntiDuplicationPolicy: fix messing up Announces --- .../web/activity_pub/mrf/anti_duplication_policy.ex | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/pleroma/web/activity_pub/mrf/anti_duplication_policy.ex b/lib/pleroma/web/activity_pub/mrf/anti_duplication_policy.ex index 92b334da39..16d4e47713 100644 --- a/lib/pleroma/web/activity_pub/mrf/anti_duplication_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/anti_duplication_policy.ex @@ -5,11 +5,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiDuplicationPolicy do @cachex Pleroma.Config.get([:cachex, :provider], Cachex) @cache :anti_duplication_mrf_cache - @object_types ~w[Note Article Page ChatMessage Question Event] - @impl true - def filter(%{"type" => type, "content" => content} = object) - when is_binary(content) and type in @object_types do + def filter(%{"type" => "Create", "object" => %{"content" => content} = object}) + when is_binary(content) do ttl = Pleroma.Config.get([:mrf_anti_duplication, :ttl], :timer.minutes(1)) min_length = Pleroma.Config.get([:mrf_anti_duplication, :min_length], 50) @@ -31,11 +29,6 @@ def filter(%{"type" => type, "content" => content} = object) end end - def filter(%{"object" => %{"type" => type, "content" => content} = object}) - when is_binary(content) and type in @object_types do - filter(object) - end - def filter(object) do {:ok, object} end