Sam Therapy
33c0a207ba
Moderators: reorganize :admin_api pipeline in Router Add block notify from Soapbox
25 lines
624 B
Elixir
25 lines
624 B
Elixir
defmodule Pleroma.Web.ActivityPub.MRF.RemoveSponsorship do
|
|
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
|
|
|
|
@impl true
|
|
def filter(
|
|
%{
|
|
"type" => "Create",
|
|
"object" => %{"content" => content, "attachment" => _} = _child_object
|
|
} = object
|
|
) do
|
|
nc =
|
|
content
|
|
|> String.replace(~r/(<p>=>|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
|