commit: 6ad4acea50ab0ac682f0f207d60a640a819c7748
parent 03e54aaba9d2d7cd7f4329f53a80f10ac71ab64d
Author: Kaede Fujisaki <kaede@hexe.net>
Date: Sat, 2 Mar 2024 18:09:08 +0900
Consider a case when inbox is nil
Diffstat:
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
@@ -159,17 +159,20 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
end
defp should_federate?(inbox, public) do
- if public do
- true
- else
- %{host: host} = URI.parse(inbox)
+ cond do
+ inbox == nil ->
+ false
+ public ->
+ true
+ true ->
+ %{host: host} = URI.parse(inbox)
- quarantined_instances =
- Config.get([:instance, :quarantined_instances], [])
- |> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
- |> Pleroma.Web.ActivityPub.MRF.subdomains_regex()
+ quarantined_instances =
+ Config.get([:instance, :quarantined_instances], [])
+ |> Pleroma.Web.ActivityPub.MRF.instance_list_from_tuples()
+ |> 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