don't publish public activities to quarantined
This commit is contained in:
parent
516d155558
commit
4e693e674e
2 changed files with 7 additions and 11 deletions
|
@ -104,18 +104,14 @@ defp signature_host(%URI{port: port, scheme: scheme, host: host}) do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp should_federate?(inbox, public) do
|
defp should_federate?(inbox, public) do
|
||||||
if public do
|
%{host: host} = URI.parse(inbox)
|
||||||
true
|
|
||||||
else
|
|
||||||
%{host: host} = URI.parse(inbox)
|
|
||||||
|
|
||||||
quarantined_instances =
|
quarantined_instances =
|
||||||
Config.get([:instance, :quarantined_instances], [])
|
Config.get([:instance, :quarantined_instances], [])
|
||||||
|> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
|
|> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
|
||||||
|> Pleroma.Web.ActivityPub.MRF.subdomains_regex()
|
|> Pleroma.Web.ActivityPub.MRF.subdomains_regex()
|
||||||
|
|
||||||
!Pleroma.Web.ActivityPub.MRF.subdomain_match?(quarantined_instances, host)
|
!Pleroma.Web.ActivityPub.MRF.subdomain_match?(quarantined_instances, host)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec recipients(User.t(), Activity.t()) :: list(User.t()) | []
|
@spec recipients(User.t(), Activity.t()) :: list(User.t()) | []
|
||||||
|
|
|
@ -267,7 +267,7 @@ test "publish to url with with different ports" do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "publish/2" do
|
describe "publish/2" do
|
||||||
test_with_mock "doesn't publish a non-public activity to quarantined instances.",
|
test_with_mock "doesn't publish any activity to quarantined instances.",
|
||||||
Pleroma.Web.Federator.Publisher,
|
Pleroma.Web.Federator.Publisher,
|
||||||
[:passthrough],
|
[:passthrough],
|
||||||
[] do
|
[] do
|
||||||
|
|
Loading…
Reference in a new issue