Introduce optional unfurling of nsfw content

This commit is contained in:
rinpatch 2019-01-17 11:00:02 +03:00
commit 4d5f15cd42
4 changed files with 14 additions and 4 deletions

View file

@ -28,4 +28,12 @@ defmodule Pleroma.Web.Metadata do
raise ArgumentError, message: "make_tag invalid args"
end
end
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)
else
false
end
end
end