aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-03-13 12:27:15 -0600
committerMark Felder <feld@feld.me>2021-03-13 12:27:15 -0600
commitb80f868c6b41d1407cf6e4f2df8913bdf7a954c0 (patch)
tree1e03f32a5bcb393951a2bbd56f7bf27a6fb096ca
parent029ff6538972b59c6259dd7345ad9c4465fb3f73 (diff)
downloadpleroma-b80f868c6b41d1407cf6e4f2df8913bdf7a954c0.tar.gz
Prefer naming this function build_image_url/2
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 581b4e952..71f659ba0 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -386,7 +386,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
nil
end
- image_url = get_image_url(image_url_data, page_url_data)
+ image_url = build_image_url(image_url_data, page_url_data)
%{
type: "link",
@@ -548,8 +548,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
# 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 get_image_url(struct() | nil, struct()) :: String.t() | nil
- defp get_image_url(
+ @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
)
@@ -557,9 +557,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
image_url_data |> to_string
end
- defp get_image_url(%URI{} = image_url_data, %URI{} = page_url_data) do
+ defp build_image_url(%URI{} = image_url_data, %URI{} = page_url_data) do
URI.merge(page_url_data, image_url_data) |> to_string
end
- defp get_image_url(_, _), do: nil
+ defp build_image_url(_, _), do: nil
end