Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into validate-user-info
authorlain <lain@soykaf.club>
Sat, 1 Dec 2018 08:55:46 +0000 (09:55 +0100)
committerlain <lain@soykaf.club>
Sat, 1 Dec 2018 08:55:46 +0000 (09:55 +0100)
1  2 
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/twitter_api/twitter_api.ex
lib/pleroma/web/twitter_api/twitter_api_controller.ex

index 3a49a96a1f4dead7656a767aa4ae089b82e56ad4,009be50e759a78515667dc49356fb07518445045..f209bb43c6ad51551bf11245f5427f2658b157cf
@@@ -71,34 -63,34 +63,34 @@@ defmodule Pleroma.Web.MastodonAPI.Masto
          user
        end
  
 -    user =
 -      if banner = params["header"] do
 -        with %Plug.Upload{} <- banner,
 -             {:ok, object} <- ActivityPub.upload(banner, type: :banner),
 -             new_info <- Map.put(user.info, "banner", object.data),
 -             change <- User.info_changeset(user, %{info: new_info}),
 -             {:ok, user} <- User.update_and_set_cache(change) do
 -          user
 -        else
 -          _e -> user
 -        end
 -      else
 -        user
 -      end
 -
 -    user =
 -      if locked = params["locked"] do
 -        with locked <- locked == "true",
 -             new_info <- Map.put(user.info, "locked", locked),
 -             change <- User.info_changeset(user, %{info: new_info}),
 -             {:ok, user} <- User.update_and_set_cache(change) do
 -          user
 -        else
 -          _e -> user
 -        end
 -      else
 -        user
 -      end
 +    # user =
 +    #   if banner = params["header"] do
 +    #     with %Plug.Upload{} <- banner,
-     #          {:ok, object} <- ActivityPub.upload(banner, banner_upload_limit),
++    #          {:ok, object} <- ActivityPub.upload(banner, type: :banner),
 +    #          new_info <- Map.put(user.info, "banner", object.data),
 +    #          change <- User.info_changeset(user, %{info: new_info}),
 +    #          {:ok, user} <- User.update_and_set_cache(change) do
 +    #       user
 +    #     else
 +    #       _e -> user
 +    #     end
 +    #   else
 +    #     user
 +    #   end
 +
 +    # user =
 +    #   if locked = params["locked"] do
 +    #     with locked <- locked == "true",
 +    #          new_info <- Map.put(user.info, "locked", locked),
 +    #          change <- User.info_changeset(user, %{info: new_info}),
 +    #          {:ok, user} <- User.update_and_set_cache(change) do
 +    #       user
 +    #     else
 +    #       _e -> user
 +    #     end
 +    #   else
 +    #     user
 +    #   end
  
      with changeset <- User.update_changeset(user, params),
           {:ok, user} <- User.update_and_set_cache(changeset) do