ActivityPub: Use only string keys in views.
authorLain Iwakura <lain@soykaf.club>
Mon, 11 Dec 2017 17:20:41 +0000 (18:20 +0100)
committerLain Iwakura <lain@soykaf.club>
Mon, 11 Dec 2017 17:20:41 +0000 (18:20 +0100)
lib/pleroma/web/activity_pub/views/user_view.ex

index 5303455a82314bca2b601c4f80a2054b635b9a19..b3b02c4fba230a989288fc2deac55006ff8b65b9 100644 (file)
@@ -8,43 +8,43 @@ defmodule Pleroma.Web.ActivityPub.UserView do
     public_key = :public_key.pem_entry_encode(:RSAPublicKey, public_key)
     public_key = :public_key.pem_encode([public_key])
     %{
-      "@context": [
+      "@context" => [
         "https://www.w3.org/ns/activitystreams",
         "https://w3id.org/security/v1",
         %{
-          "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
-          "sensitive": "as:sensitive",
-          "Hashtag": "as:Hashtag",
-          "ostatus": "http://ostatus.org#",
-          "atomUri": "ostatus:atomUri",
-          "inReplyToAtomUri": "ostatus:inReplyToAtomUri",
-          "conversation": "ostatus:conversation",
-          "toot": "http://joinmastodon.org/ns#",
-          "Emoji": "toot:Emoji"
+          "manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
+          "sensitive" => "as:sensitive",
+          "Hashtag" => "as:Hashtag",
+          "ostatus" => "http://ostatus.org#",
+          "atomUri" => "ostatus:atomUri",
+          "inReplyToAtomUri" => "ostatus:inReplyToAtomUri",
+          "conversation" => "ostatus:conversation",
+          "toot" => "http://joinmastodon.org/ns#",
+          "Emoji" => "toot:Emoji"
         }
       ],
-      "id": user.ap_id,
-      "type": "Person",
-      "following": "#{user.ap_id}/following",
-      "followers": "#{user.ap_id}/followers",
-      "inbox": "#{user.ap_id}/inbox",
-      "outbox": "#{user.ap_id}/outbox",
-      "preferredUsername": user.nickname,
-      "name": user.name,
-      "summary": user.bio,
-      "url": user.ap_id,
-      "manuallyApprovesFollowers": false,
-      "publicKey": %{
-        "id": "#{user.ap_id}#main-key",
-        "owner": user.ap_id,
-        "publicKeyPem": public_key
+      "id" => user.ap_id,
+      "type" => "Person",
+      "following" => "#{user.ap_id}/following",
+      "followers" => "#{user.ap_id}/followers",
+      "inbox" => "#{user.ap_id}/inbox",
+      "outbox" => "#{user.ap_id}/outbox",
+      "preferredUsername" => user.nickname,
+      "name" => user.name,
+      "summary" => user.bio,
+      "url" => user.ap_id,
+      "manuallyApprovesFollowers" => false,
+      "publicKey" => %{
+        "id" => "#{user.ap_id}#main-key",
+        "owner" => user.ap_id,
+        "publicKeyPem" => public_key
       },
-      "endpoints": %{
-        "sharedInbox": "#{Pleroma.Web.Endpoint.url}/inbox"
+      "endpoints" => %{
+        "sharedInbox" => "#{Pleroma.Web.Endpoint.url}/inbox"
       },
-      "icon": %{
-        "type": "Image",
-        "url": User.avatar_url(user)
+      "icon" => %{
+        "type" => "Image",
+        "url" => User.avatar_url(user)
       }
     }
   end