rework to use properties instead of compound typing, per SocialCG
authorAriadne Conill <ariadne@dereferenced.org>
Sat, 19 Oct 2019 17:46:24 +0000 (17:46 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Sat, 19 Oct 2019 23:21:37 +0000 (23:21 +0000)
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/activity_pub/views/user_view.ex
priv/static/schemas/litepub-0.1.jsonld
test/fixtures/tesla_mock/relay@mastdon.example.org.json

index 1cfe826fad13f4bcf1ae20f3b2c5f19bd268a01a..9a0a3522af567cea6bef4059f15ee3ebd20287ed 100644 (file)
@@ -1106,13 +1106,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     locked = data["manuallyApprovesFollowers"] || false
     data = Transmogrifier.maybe_fix_user_object(data)
     discoverable = data["discoverable"] || false
-
-    invisible =
-      if is_list(data["type"]) do
-        Enum.member?(data["type"], "Invisible")
-      else
-        false
-      end
+    invisible = data["invisible"] || false
 
     user_data = %{
       ap_id: data["id"],
index 49bbeb8579e490dbe436629dccbf9896ebafcc6c..4a250d131d6dcedbe40cb6705899aae49717055c 100644 (file)
@@ -600,8 +600,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
              "Person",
              "Application",
              "Service",
-             "Organization",
-             ["Application", "Invisible"]
+             "Organization"
            ] do
     with %User{ap_id: ^actor_id} = actor <- User.get_cached_by_ap_id(object["id"]) do
       {:ok, new_user_data} = ActivityPub.user_data_from_user_object(object)
index 9b39d1629144d0f5f130d271ed2c58862a236a95..8c5b4460bfd767350c45e6cb70be97fc69745982 100644 (file)
@@ -55,7 +55,8 @@ defmodule Pleroma.Web.ActivityPub.UserView do
         "owner" => user.ap_id,
         "publicKeyPem" => public_key
       },
-      "endpoints" => endpoints
+      "endpoints" => endpoints,
+      "invisible" => User.invisible?(user)
     }
     |> Map.merge(Utils.make_json_ld_header())
   end
index 1cfcb7ec7025e678885ea5b9c53b98156974dc02..c8e69cab5614b44fe0a3d3a7d1ee33af8e4e6a2c 100644 (file)
@@ -19,6 +19,7 @@
             "value": "schema:value",
             "sensitive": "as:sensitive",
             "litepub": "http://litepub.social/ns#",
+            "invisible": "litepub:invisible",
             "directMessage": "litepub:directMessage",
             "listMessage": {
                 "@id": "litepub:listMessage",
index b70be2bf465f6e2f98630ac1d1d455f1ca37964a..c1fab7d3b4c486b52622e39bb9e2576d68220d7e 100644 (file)
@@ -12,7 +12,8 @@
     "Emoji": "toot:Emoji"
   }],
   "id": "http://mastodon.example.org/users/admin",
-  "type": ["Application", "Invisible"],
+  "type": "Application",
+  "invisible": true,
   "following": "http://mastodon.example.org/users/admin/following",
   "followers": "http://mastodon.example.org/users/admin/followers",
   "inbox": "http://mastodon.example.org/users/admin/inbox",