def build_tags(params) do
providers = [
- Pleroma.Web.Metadata.Providers.Feed,
Pleroma.Web.Metadata.Providers.RelMe,
Pleroma.Web.Metadata.Providers.RestrictIndexing
| activated_providers()
defp activated_providers do
unless Pleroma.Config.restrict_unauthenticated_access?(:activities, :local) do
- Pleroma.Config.get([__MODULE__, :providers], [])
+ [Pleroma.Web.Metadata.Providers.Feed | Pleroma.Config.get([__MODULE__, :providers], [])]
else
[]
end
@impl Provider
def build_tags(%{user: user}) do
- if Pleroma.Config.get!([:instance, :public]) do
- [
- {:link,
- [
- rel: "alternate",
- type: "application/atom+xml",
- href: Helpers.user_feed_path(Endpoint, :feed, user.nickname) <> ".atom"
- ], []}
- ]
- else
- []
- end
+ [
+ {:link,
+ [
+ rel: "alternate",
+ type: "application/atom+xml",
+ href: Helpers.user_feed_path(Endpoint, :feed, user.nickname) <> ".atom"
+ ], []}
+ ]
end
end
end
describe "no metadata for private instances" do
- setup do: clear_config([:instance, :public])
-
test "for local user" do
- Pleroma.Config.put([:instance, :public], false)
+ clear_config([:instance, :public], false)
user = insert(:user, bio: "This is my secret fedi account bio")
assert "" = Pleroma.Web.Metadata.build_tags(%{user: user})