Merge branch 'atom-tag' into 'develop'

Metadata: Do not include .atom feed links for remote accounts

See merge request pleroma/pleroma!4281
This commit is contained in:
lain 2024-11-12 09:44:29 +00:00
commit ee3ab8b625
3 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1 @@
Metadata: Do not include .atom feed links for remote accounts

View file

@ -10,7 +10,7 @@ defmodule Pleroma.Web.Metadata.Providers.Feed do
@behaviour Provider @behaviour Provider
@impl Provider @impl Provider
def build_tags(%{user: user}) do def build_tags(%{user: %{local: true} = user}) do
[ [
{:link, {:link,
[ [
@ -20,4 +20,6 @@ defmodule Pleroma.Web.Metadata.Providers.Feed do
], []} ], []}
] ]
end end
def build_tags(_), do: []
end end

View file

@ -15,4 +15,10 @@ defmodule Pleroma.Web.Metadata.Providers.FeedTest do
[rel: "alternate", type: "application/atom+xml", href: "/users/lain/feed.atom"], []} [rel: "alternate", type: "application/atom+xml", href: "/users/lain/feed.atom"], []}
] ]
end end
test "it doesn't render a link to remote user's feed" do
user = insert(:user, nickname: "lain@lain.com", local: false)
assert Feed.build_tags(%{user: user}) == []
end
end end