Introduce optional unfurling of nsfw content
This commit is contained in:
parent
0256bd2f1d
commit
4d5f15cd42
4 changed files with 14 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue