AntiDuplicationPolicy: fix messing up Announces
This commit is contained in:
parent
663574bea9
commit
7adead8df8
1 changed files with 2 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue