From: Alex Gleason Date: Wed, 14 Oct 2020 17:33:24 +0000 (-0500) Subject: Merge remote-tracking branch 'upstream/develop' into aliases X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=83770b7b391fdf8bdc22f63047b1cf444a7b16ce;p=akkoma Merge remote-tracking branch 'upstream/develop' into aliases --- 83770b7b391fdf8bdc22f63047b1cf444a7b16ce diff --cc lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 2b981a864,97858a93c..fb1552f21 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@@ -211,7 -209,7 +210,8 @@@ defmodule Pleroma.Web.MastodonAPI.Accou if bot, do: {:ok, "Service"}, else: {:ok, "Person"} end) |> Maps.put_if_present(:actor_type, params[:actor_type]) + |> Maps.put_if_present(:also_known_as, params[:also_known_as]) + |> Maps.put_if_present(:is_locked, params[:locked]) # What happens here: # diff --cc test/pleroma/web/mastodon_api/update_credentials_test.exs index 0d49eb334,ed1921c91..e99508cd8 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@@ -220,19 -220,9 +220,19 @@@ defmodule Pleroma.Web.MastodonAPI.Updat assert update_activity.data["object"]["name"] == "markorepairs" end + test "updates the user's AKAs", %{conn: conn} do + conn = + patch(conn, "/api/v1/accounts/update_credentials", %{ + "also_known_as" => ["https://mushroom.kingdom/users/mario"] + }) + + assert user_data = json_response_and_validate_schema(conn, 200) + assert user_data["pleroma"]["also_known_as"] == ["https://mushroom.kingdom/users/mario"] + end + test "updates the user's avatar", %{user: user, conn: conn} do new_avatar = %Plug.Upload{ - content_type: "image/jpg", + content_type: "image/jpeg", path: Path.absname("test/fixtures/image.jpg"), filename: "an_image.jpg" }