Finish undoing API breakage
authorMark Felder <feld@FreeBSD.org>
Wed, 14 Oct 2020 15:44:18 +0000 (10:44 -0500)
committerMark Felder <feld@FreeBSD.org>
Wed, 14 Oct 2020 15:44:18 +0000 (10:44 -0500)
lib/pleroma/web/activity_pub/views/user_view.ex
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
lib/pleroma/web/mastodon_api/views/account_view.ex
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
test/pleroma/web/mastodon_api/views/account_view_test.exs

index 81cd7e81d33ee1b0ba84f3b50805059e6e2caa88..e57c911498740415408af8d13b58904cc3ac4a71 100644 (file)
@@ -110,7 +110,7 @@ defmodule Pleroma.Web.ActivityPub.UserView 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))
index 6453880dcbc7a53e46063050f70191c506b3ed66..9d2f42da95ee8c0df19ded7f5d323cb826fb90c5 100644 (file)
@@ -186,7 +186,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
         :show_role,
         :skip_thread_containment,
         :allow_following_move,
-        :is_discoverable,
         :accepts_chat_messages
       ]
       |> Enum.reduce(%{}, fn key, acc ->
@@ -210,6 +209,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
         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:
     #
index 0636d9cc1164798f4295521bc0d2ad24ab75a995..d57537ee3cfab45ee599a2257625bc7452fbc572 100644 (file)
@@ -261,7 +261,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
         sensitive: false,
         fields: user.raw_fields,
         pleroma: %{
-          is_discoverable: user.is_discoverable,
+          discoverable: user.is_discoverable,
           actor_type: user.actor_type
         }
       },
index f7eb97dbb515bf9d9e62e02cf5a55062958ccab3..f7f1369e48e35d70a19d925a2a3c2d2f66a05b00 100644 (file)
@@ -1278,7 +1278,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
                  "note" => "",
                  "pleroma" => %{
                    "actor_type" => "Person",
-                   "is_discoverable" => false,
+                   "discoverable" => false,
                    "no_rich_text" => false,
                    "show_role" => true
                  },
index 3b0454df24cb73d033e1b7a31e1048aecd05666b..a5f39b215dd6e5ad92ba2962b49506ed21abaa60 100644 (file)
@@ -69,7 +69,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
         sensitive: false,
         pleroma: %{
           actor_type: "Person",
-          is_discoverable: true
+          discoverable: true
         },
         fields: []
       },
@@ -167,7 +167,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
         sensitive: false,
         pleroma: %{
           actor_type: "Service",
-          is_discoverable: true
+          discoverable: true
         },
         fields: []
       },