Metadata: Do not include .atom feed links for remote accounts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
d2eb4992e2
commit
0c41d986de
3 changed files with 10 additions and 1 deletions
1
changelog.d/atom-tag.change
Normal file
1
changelog.d/atom-tag.change
Normal file
|
@ -0,0 +1 @@
|
|||
Metadata: Do not include .atom feed links for remote accounts
|
|
@ -10,7 +10,7 @@ defmodule Pleroma.Web.Metadata.Providers.Feed do
|
|||
@behaviour Provider
|
||||
|
||||
@impl Provider
|
||||
def build_tags(%{user: user}) do
|
||||
def build_tags(%{user: %{local: true} = user}) do
|
||||
[
|
||||
{:link,
|
||||
[
|
||||
|
@ -20,4 +20,6 @@ def build_tags(%{user: user}) do
|
|||
], []}
|
||||
]
|
||||
end
|
||||
|
||||
def build_tags(_), do: []
|
||||
end
|
||||
|
|
|
@ -15,4 +15,10 @@ test "it renders a link to user's atom feed" do
|
|||
[rel: "alternate", type: "application/atom+xml", href: "/users/lain/feed.atom"], []}
|
||||
]
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue