aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-06-14 11:19:22 +0200
committerlain <lain@soykaf.club>2019-06-14 11:19:22 +0200
commiteac298083f809d2cf629640b02fc0ae33dc7b9d2 (patch)
tree89afa7909e21fbd259abb0367d48b4d9feb1e251 /lib
parent5965efb216bc2df7af9ab01129f5bcadd3f23d59 (diff)
downloadpleroma-eac298083f809d2cf629640b02fc0ae33dc7b9d2.tar.gz
MastodonAPI: Add a way to update the background image.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index 46049dd24..891f9d814 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -136,6 +136,14 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
_ -> :error
end
end)
+ |> add_if_present(params, "pleroma_background_image", :background, fn value ->
+ with %Plug.Upload{} <- value,
+ {:ok, object} <- ActivityPub.upload(value, type: :background) do
+ {:ok, object.data}
+ else
+ _ -> :error
+ end
+ end)
|> Map.put(:emoji, user_info_emojis)
info_cng = User.Info.profile_update(user.info, info_params)