mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 16:16:34 +00:00
activitypub: mrf: tag policy: add support for subscription control
This commit is contained in:
parent
ff2c28fd6d
commit
64a3993425
1 changed files with 15 additions and 0 deletions
|
@ -85,6 +85,21 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
|
|||
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}
|
||||
|
||||
def filter_message(actor, message) do
|
||||
|
|
Loading…
Reference in a new issue