- def activity_nsfw?(%{data: %{"object" => %{"tag" => tags}}}) do
- if(Pleroma.Config.get([__MODULE__, :unfurl_nsfw], false) == false) do
- Enum.any?(tags, fn tag -> tag == "nsfw" end)
+ def activity_nsfw?(%{data: %{"sensitive" => sensitive}}) do
+ Pleroma.Config.get([__MODULE__, :unfurl_nsfw], false) == false and sensitive
+ end
+
+ def activity_nsfw?(_) do
+ false
+ end
+
+ defp activated_providers do
+ unless Pleroma.Config.restrict_unauthenticated_access?(:activities, :local) do
+ [Pleroma.Web.Metadata.Providers.Feed | Pleroma.Config.get([__MODULE__, :providers], [])]