summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2024-08-29 15:27:53 +0000
committerfeld <feld@feld.me>2024-08-29 15:27:53 +0000
commit62856ab18f8992fb73cb27db40bbea9f29b5d1b6 (patch)
tree57949ffc4ce8fd97e762c375a2f5c38e8d058df6 /lib
parent8d0703460851155296255561b23ab22696446803 (diff)
parentb5814dc9b36850962027abb2e99d64d3084048e6 (diff)
downloadpleroma-62856ab18f8992fb73cb27db40bbea9f29b5d1b6.tar.gz
pleroma-62856ab18f8992fb73cb27db40bbea9f29b5d1b6.zip
Merge branch 'todo-fixes' into 'develop'
Clean up Elixir 1.13 TODOs See merge request pleroma/pleroma!4233
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/maps.ex4
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex14
2 files changed, 2 insertions, 16 deletions
diff --git a/lib/pleroma/maps.ex b/lib/pleroma/maps.ex
index 5020a8ff8..1afbde484 100644
--- a/lib/pleroma/maps.ex
+++ b/lib/pleroma/maps.ex
@@ -20,15 +20,13 @@ defmodule Pleroma.Maps do
end
def filter_empty_values(data) do
- # TODO: Change to Map.filter in Elixir 1.13+
data
- |> Enum.filter(fn
+ |> Map.filter(fn
{_k, nil} -> false
{_k, ""} -> false
{_k, []} -> false
{_k, %{} = v} -> Map.keys(v) != []
{_k, _v} -> true
end)
- |> Map.new()
end
end
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