diff options
author | rinpatch <rinpatch@sdf.org> | 2019-02-02 12:04:18 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-02-02 12:04:18 +0300 |
commit | 833404f0f549a5c2ac58d43239217648cc354a6a (patch) | |
tree | 5bc3c7acb5b5b7fe3793bf9812bb72d77fbe8bcb /lib | |
parent | e4d18f328b738a2c3a953e721f0d350cfba20089 (diff) | |
download | pleroma-833404f0f549a5c2ac58d43239217648cc354a6a.tar.gz |
Use with instead of if in the card
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index aa38784a6..c8fde93ba 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -186,11 +186,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do page_url_data = URI.parse(page_url) image_url = - if %URI{host: nil} = page_url_data do + with %URI{host: nil} <- page_url_data do rich_media[:image] else - URI.merge(page_url_data, URI.parse(rich_media[:image])) - |> to_string + _ -> + URI.merge(page_url_data, URI.parse(rich_media[:image])) + |> to_string end site_name = rich_media[:site_name] || page_url_data.host |