[#394] User view (Twitter & Mastadon API): wrapped "tags" in "pleroma" map.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 6 Dec 2018 19:26:25 +0000 (22:26 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Thu, 6 Dec 2018 19:26:25 +0000 (22:26 +0300)
lib/pleroma/web/mastodon_api/views/account_view.ex
lib/pleroma/web/twitter_api/views/user_view.ex
test/web/mastodon_api/account_view_test.exs
test/web/twitter_api/views/user_view_test.exs

index 2762813aeba75ddad75ec749b67069a4c6f1c59a..ebcf9230bc8959b5735cb5888a4f37c1c246dd9b 100644 (file)
@@ -59,8 +59,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
         privacy: user_info.default_scope,
         sensitive: false
       },
+
       # Pleroma extension
-      tags: user.tags
+      pleroma: %{
+        tags: user.tags
+      }
     }
   end
 
index f460ddd80bbec5790f5873b1c8a7147d166feca5..b3459af9af7768cc2316b1f122f75fecfeee193f 100644 (file)
@@ -78,8 +78,11 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "default_scope" => user.info.default_scope,
       "no_rich_text" => user.info.no_rich_text,
       "fields" => fields,
+
       # Pleroma extension
-      "tags" => user.tags
+      "pleroma" => %{
+        "tags" => user.tags
+      }
     }
 
     if assigns[:token] do
index d6c9f58c890dcf8135ce2825cc908da480b18c01..3cb9b9c5be74d0286639cc5ddd4eb6045155a925 100644 (file)
@@ -55,7 +55,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
         privacy: "public",
         sensitive: false
       },
-      tags: []
+      pleroma: %{tags: []}
     }
 
     assert expected == AccountView.render("account.json", %{user: user})
@@ -93,7 +93,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
         privacy: "public",
         sensitive: false
       },
-      tags: []
+      pleroma: %{tags: []}
     }
 
     assert expected == AccountView.render("account.json", %{user: user})
index 0bd06f256d30f192c0b1c8717124e12667706062..9898c217d6764f3f0921ffe9d2bf439849d48ead 100644 (file)
@@ -97,7 +97,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "default_scope" => "public",
       "no_rich_text" => false,
       "fields" => [],
-      "tags" => []
+      "pleroma" => %{"tags" => []}
     }
 
     assert represented == UserView.render("show.json", %{user: user})
@@ -139,7 +139,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "default_scope" => "public",
       "no_rich_text" => false,
       "fields" => [],
-      "tags" => []
+      "pleroma" => %{"tags" => []}
     }
 
     assert represented == UserView.render("show.json", %{user: user, for: follower})
@@ -182,7 +182,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "default_scope" => "public",
       "no_rich_text" => false,
       "fields" => [],
-      "tags" => []
+      "pleroma" => %{"tags" => []}
     }
 
     assert represented == UserView.render("show.json", %{user: follower, for: user})
@@ -232,7 +232,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "default_scope" => "public",
       "no_rich_text" => false,
       "fields" => [],
-      "tags" => []
+      "pleroma" => %{"tags" => []}
     }
 
     blocker = Repo.get(User, blocker.id)