projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
029ff65
)
Prefer naming this function build_image_url/2
author
Mark Felder
<feld@feld.me>
Sat, 13 Mar 2021 18:27:15 +0000
(12:27 -0600)
committer
Mark Felder
<feld@feld.me>
Sat, 13 Mar 2021 18:27:15 +0000
(12:27 -0600)
lib/pleroma/web/mastodon_api/views/status_view.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/mastodon_api/views/status_view.ex
b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 581b4e952322555529dea89215f992156a2b95d7..71f659ba05914e779ac9cf423782a5253edee109 100644
(file)
--- 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
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",
%{
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
# 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
)
%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
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
URI.merge(page_url_data, image_url_data) |> to_string
end
- defp
get
_image_url(_, _), do: nil
+ defp
build
_image_url(_, _), do: nil
end
end