1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-12-25 04:53:06 +00:00

Merge branch 'fix/tag-urls' into 'develop'

Make tag urls absolute

See merge request pleroma/pleroma!3272
This commit is contained in:
Haelwenn 2021-01-22 03:21:26 +00:00
commit 42e495df2b
3 changed files with 6 additions and 5 deletions

View file

@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Streaming API: Posts and notifications are not dropped, when CLI task is executing. - Streaming API: Posts and notifications are not dropped, when CLI task is executing.
- Creating incorrect IPv4 address-style HTTP links when encountering certain numbers. - Creating incorrect IPv4 address-style HTTP links when encountering certain numbers.
- Reblog API Endpoint: Do not set visibility parameter to public by default and let CommonAPI to infer it from status, so a user can reblog their private status without explicitly setting reblog visibility to private. - Reblog API Endpoint: Do not set visibility parameter to public by default and let CommonAPI to infer it from status, so a user can reblog their private status without explicitly setting reblog visibility to private.
- Tag URLs in statuses are now absolute
<details> <details>
<summary>API Changes</summary> <summary>API Changes</summary>

View file

@ -491,7 +491,7 @@ def render_content(object), do: object.data["content"] || ""
def build_tags(object_tags) when is_list(object_tags) do def build_tags(object_tags) when is_list(object_tags) do
object_tags object_tags
|> Enum.filter(&is_binary/1) |> Enum.filter(&is_binary/1)
|> Enum.map(&%{name: &1, url: "/tag/#{URI.encode(&1)}"}) |> Enum.map(&%{name: &1, url: "#{Pleroma.Web.base_url()}/tag/#{URI.encode(&1)}"})
end end
def build_tags(_), do: [] def build_tags(_), do: []

View file

@ -263,7 +263,7 @@ test "a note activity" do
tags: [ tags: [
%{ %{
name: "#{object_data["tag"]}", name: "#{object_data["tag"]}",
url: "/tag/#{object_data["tag"]}" url: "http://localhost:4001/tag/#{object_data["tag"]}"
} }
], ],
application: %{ application: %{
@ -585,9 +585,9 @@ test "it returns a a dictionary tags" do
] ]
assert StatusView.build_tags(object_tags) == [ assert StatusView.build_tags(object_tags) == [
%{name: "fediverse", url: "/tag/fediverse"}, %{name: "fediverse", url: "http://localhost:4001/tag/fediverse"},
%{name: "mastodon", url: "/tag/mastodon"}, %{name: "mastodon", url: "http://localhost:4001/tag/mastodon"},
%{name: "nextcloud", url: "/tag/nextcloud"} %{name: "nextcloud", url: "http://localhost:4001/tag/nextcloud"}
] ]
end end
end end