X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fmetadata.ex;h=0f2d8d1e73635f48ee9bfc0720bb8ede642ff726;hb=7a1cb752dd41856cfbfb2078353e5703a8ec375c;hp=8761260f2cd7398fd244f2b8397a160adfb60eb9;hpb=c00fba4f7dcf10c49bf1fa03be348e7c99a3fc47;p=akkoma
diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex
index 8761260f2..0f2d8d1e7 100644
--- a/lib/pleroma/web/metadata.ex
+++ b/lib/pleroma/web/metadata.ex
@@ -1,12 +1,18 @@
# 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.RelMe,
+ Pleroma.Web.Metadata.Providers.RestrictIndexing
+ | activated_providers()
+ ]
+
+ Enum.reduce(providers, "", fn parser, acc ->
rendered_html =
params
|> parser.build_tags()
@@ -37,4 +43,12 @@ defmodule Pleroma.Web.Metadata do
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], [])]
+ else
+ []
+ end
+ end
end