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)
|
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
|
||||||
@cache :anti_duplication_mrf_cache
|
@cache :anti_duplication_mrf_cache
|
||||||
|
|
||||||
@object_types ~w[Note Article Page ChatMessage Question Event]
|
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def filter(%{"type" => type, "content" => content} = object)
|
def filter(%{"type" => "Create", "object" => %{"content" => content} = object})
|
||||||
when is_binary(content) and type in @object_types do
|
when is_binary(content) do
|
||||||
ttl = Pleroma.Config.get([:mrf_anti_duplication, :ttl], :timer.minutes(1))
|
ttl = Pleroma.Config.get([:mrf_anti_duplication, :ttl], :timer.minutes(1))
|
||||||
min_length = Pleroma.Config.get([:mrf_anti_duplication, :min_length], 50)
|
min_length = Pleroma.Config.get([:mrf_anti_duplication, :min_length], 50)
|
||||||
|
|
||||||
|
@ -31,11 +29,6 @@ def filter(%{"type" => type, "content" => content} = object)
|
||||||
end
|
end
|
||||||
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
|
def filter(object) do
|
||||||
{:ok, object}
|
{:ok, object}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue