Add sponsorship mrf

This commit is contained in:
Your New SJW Waifu 2020-03-25 14:59:24 -05:00
parent 2bb5ade487
commit 98472b04bf
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
defmodule Site.RemoveSponsorship do
@behaviour Pleroma.Web.ActivityPub.MRF
@impl true
def filter(
%{
"type" => "Create",
"object" => %{"content" => content, "attachment" => _} = _child_object
} = object
) do
nc =
content
|> String.replace(~r/(<p>=&gt;|ufgloves).*/, "")
|> String.replace(~r/<p>--<br \/>Original: <a href="https:\/\/www\.twitter\.com\/.*/, "")
{:ok, put_in(object, ["object", "content"], nc)}
end
@impl true
def filter(object), do: {:ok, object}
@impl true
def describe, do: {:ok, %{}}
end