activitypub: mrf: tag policy: add support for subscription control

This commit is contained in:
William Pitcock 2019-02-04 17:48:48 +00:00
parent ff2c28fd6d
commit 64a3993425

View file

@ -85,6 +85,21 @@ defp process_tag(
end end
end end
defp process_tag(
"mrf_tag:disable-remote-subscription",
%{"type" => "Follow", "actor" => actor} = message
) do
user = User.get_cached_by_ap_id(actor)
if user.local == true do
{:ok, message}
else
{:reject, nil}
end
end
defp process_tag("mrf_tag:disable-any-subscription", %{"type" => "Follow"}), do: {:reject, nil}
defp process_tag(_, message), do: {:ok, message} defp process_tag(_, message), do: {:ok, message}
def filter_message(actor, message) do def filter_message(actor, message) do