Web.MastodonAPI.AccountView: Add is_moderator and is_admin
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 27 Jan 2019 09:21:13 +0000 (10:21 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 27 Jan 2019 09:33:22 +0000 (10:33 +0100)
Closes: https://git.pleroma.social/pleroma/pleroma/issues/557
lib/pleroma/web/mastodon_api/views/account_view.ex
test/web/mastodon_api/account_view_test.exs

index bfd6b8b220dca47de79e7cf4c0dbb6c80325d3f0..0ba4289da8cc75148abf9beede9a11d6f26bbf75 100644 (file)
@@ -112,7 +112,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
       # Pleroma extension
       pleroma: %{
         confirmation_pending: user_info.confirmation_pending,
-        tags: user.tags
+        tags: user.tags,
+        is_moderator: user.info.is_moderator,
+        is_admin: user.info.is_admin
       }
     }
   end
index d53e119630610fae1a493634277fb531a92d4774..f8cd68173b2d6ad0384d346b676ae96a896b2c9c 100644 (file)
@@ -61,7 +61,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
       },
       pleroma: %{
         confirmation_pending: false,
-        tags: []
+        tags: [],
+        is_admin: false,
+        is_moderator: false
       }
     }
 
@@ -102,7 +104,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
       },
       pleroma: %{
         confirmation_pending: false,
-        tags: []
+        tags: [],
+        is_admin: false,
+        is_moderator: false
       }
     }