don't publish public activities to quarantined
Some checks are pending
ci/woodpecker/push/docs Pipeline is pending
ci/woodpecker/push/release Pipeline is pending
ci/woodpecker/push/test Pipeline is pending

This commit is contained in:
FloatingGhost 2022-07-25 17:30:02 +01:00
parent 516d155558
commit 4e693e674e
2 changed files with 7 additions and 11 deletions

View file

@ -104,9 +104,6 @@ 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
true
else
%{host: host} = URI.parse(inbox) %{host: host} = URI.parse(inbox)
quarantined_instances = quarantined_instances =
@ -116,7 +113,6 @@ defp should_federate?(inbox, public) do
!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()) | []
defp recipients(actor, activity) do defp recipients(actor, activity) do

View file

@ -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