summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-06-13 19:08:05 +0200
committerlain <lain@soykaf.club>2019-06-13 19:08:05 +0200
commit5965efb216bc2df7af9ab01129f5bcadd3f23d59 (patch)
tree50ab2b7e9fdc913e134cddf9f0c8a246cf32ebf9 /lib
parent6f5a0cc14e99cb26ef009cf8cf16f38902d5e11b (diff)
downloadpleroma-5965efb216bc2df7af9ab01129f5bcadd3f23d59.tar.gz
pleroma-5965efb216bc2df7af9ab01129f5bcadd3f23d59.zip
AccountView: Add user background.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/account_view.ex6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex
index b91726b45..0ec9ecd93 100644
--- a/lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -125,7 +125,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
hide_follows: user.info.hide_follows,
hide_favorites: user.info.hide_favorites,
relationship: relationship,
- skip_thread_containment: user.info.skip_thread_containment
+ skip_thread_containment: user.info.skip_thread_containment,
+ background_image: image_url(user.info.background) |> MediaProxy.url()
}
}
|> maybe_put_role(user, opts[:for])
@@ -182,4 +183,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
end
defp maybe_put_notification_settings(data, _, _), do: data
+
+ defp image_url(%{"url" => [%{"href" => href} | _]}), do: href
+ defp image_url(_), do: nil
end