1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-18 10:59:17 +00:00

Finish undoing API breakage

This commit is contained in:
Mark Felder 2020-10-14 10:44:18 -05:00
parent 3242cfef20
commit b001237b79
5 changed files with 6 additions and 6 deletions

View file

@ -110,7 +110,7 @@ def render("user.json", %{user: user}) do
"endpoints" => endpoints,
"attachment" => fields,
"tag" => emoji_tags,
"is_discoverable" => user.is_discoverable,
"discoverable" => user.is_discoverable,
"capabilities" => capabilities
}
|> Map.merge(maybe_make_image(&User.avatar_url/2, "icon", user))

View file

@ -186,7 +186,6 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p
:show_role,
:skip_thread_containment,
:allow_following_move,
:is_discoverable,
:accepts_chat_messages
]
|> Enum.reduce(%{}, fn key, acc ->
@ -210,6 +209,7 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p
if bot, do: {:ok, "Service"}, else: {:ok, "Person"}
end)
|> Maps.put_if_present(:actor_type, params[:actor_type])
|> Maps.put_if_present(:is_discoverable, params[:discoverable])
# What happens here:
#

View file

@ -261,7 +261,7 @@ defp do_render("show.json", %{user: user} = opts) do
sensitive: false,
fields: user.raw_fields,
pleroma: %{
is_discoverable: user.is_discoverable,
discoverable: user.is_discoverable,
actor_type: user.actor_type
}
},

View file

@ -1278,7 +1278,7 @@ test "registration from trusted app" do
"note" => "",
"pleroma" => %{
"actor_type" => "Person",
"is_discoverable" => false,
"discoverable" => false,
"no_rich_text" => false,
"show_role" => true
},

View file

@ -69,7 +69,7 @@ test "Represent a user account" do
sensitive: false,
pleroma: %{
actor_type: "Person",
is_discoverable: true
discoverable: true
},
fields: []
},
@ -167,7 +167,7 @@ test "Represent a Service(bot) account" do
sensitive: false,
pleroma: %{
actor_type: "Service",
is_discoverable: true
discoverable: true
},
fields: []
},