mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-21 23:56:30 +00:00
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:
commit
ee3ab8b625
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
|
@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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue