summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-08-21 15:11:41 -0400
committerMark Felder <feld@feld.me>2024-08-21 15:11:42 -0400
commite65555e8c5cacb36a404579f56fb501a7fba0781 (patch)
treea27ca0dda80bb1cec65d3adf745f1d2666a476e6
parent010edcbcb51dfddc83d5a3810c257c1678429c2d (diff)
downloadpleroma-e65555e8c5cacb36a404579f56fb501a7fba0781.tar.gz
pleroma-e65555e8c5cacb36a404579f56fb501a7fba0781.zip
Remove workaround for URI.merge bug on nil fields before Elixir 1.13
https://github.com/elixir-lang/elixir/issues/10771
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 747638c53..1b78477d0 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -803,19 +803,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
defp build_application(_), do: nil
- # Workaround for Elixir issue #10771
- # Avoid applying URI.merge unless necessary
- # TODO: revert to always attempting URI.merge(image_url_data, page_url_data)
- # when Elixir 1.12 is the minimum supported version
- @spec build_image_url(struct() | nil, struct()) :: String.t() | nil
- defp build_image_url(
- %URI{scheme: image_scheme, host: image_host} = image_url_data,
- %URI{} = _page_url_data
- )
- when not is_nil(image_scheme) and not is_nil(image_host) do
- image_url_data |> to_string
- end
-
+ @spec build_image_url(URI.t(), URI.t()) :: String.t()
defp build_image_url(%URI{} = image_url_data, %URI{} = page_url_data) do
URI.merge(page_url_data, image_url_data) |> to_string
end