X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmetadata.ex;h=a9f70c43e32259b23b732eb5dc16c0124a17c00e;hb=b0439df1b529301c8f07097bedb1cba2602a4143;hp=be3c384ae9e19961d58a2f2bdfccf21f1769a89f;hpb=4d5f15cd422abd3a2dce6f6022c75014c18c73cf;p=akkoma
diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex
index be3c384ae..a9f70c43e 100644
--- a/lib/pleroma/web/metadata.ex
+++ b/lib/pleroma/web/metadata.ex
@@ -1,11 +1,17 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.Metadata do
alias Phoenix.HTML
def build_tags(params) do
- Enum.reduce(Pleroma.Config.get([__MODULE__, :providers], []), "", fn parser, acc ->
+ providers = [
+ Pleroma.Web.Metadata.Providers.RestrictIndexing
+ | Pleroma.Config.get([__MODULE__, :providers], [])
+ ]
+
+ Enum.reduce(providers, "", fn parser, acc ->
rendered_html =
params
|> parser.build_tags()
@@ -29,11 +35,11 @@ defmodule Pleroma.Web.Metadata do
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
+ def activity_nsfw?(%{data: %{"sensitive" => sensitive}}) do
+ Pleroma.Config.get([__MODULE__, :unfurl_nsfw], false) == false and sensitive
+ end
+
+ def activity_nsfw?(_) do
+ false
end
end