X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fweb%2Fmetadata.ex;h=46ef00c088f9caf076fbffa0d6d50054ccce57ef;hb=50913c4dc5c394b55fa5d62e6ab3cc72f3959c5d;hp=8761260f2cd7398fd244f2b8397a160adfb60eb9;hpb=74346a7035d950ede143d65f8364194cb116aaf5;p=akkoma
diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex
index 8761260f2..46ef00c08 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-2021 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