Merge branch 'feature/user-configurable-mascot' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / views / account_view.ex
index 6e6f0ba9304a97f9257156f5cc3907d7e9be592d..134c07b7eb57228e2b8b6bbfda16b9f4bae2a915 100644 (file)
@@ -40,7 +40,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
     follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target)
 
     requested =
-      if follow_activity do
+      if follow_activity && !User.following?(target, user) do
         follow_activity.data["state"] == "pending"
       else
         false
@@ -113,7 +113,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
       bot: bot,
       source: %{
         note: "",
-        sensitive: false
+        sensitive: false,
+        pleroma: %{}
       },
 
       # Pleroma extension
@@ -145,8 +146,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
        ) do
     data
     |> Kernel.put_in([:source, :privacy], user_info.default_scope)
-    |> Kernel.put_in([:pleroma, :show_role], user.info.show_role)
-    |> Kernel.put_in([:pleroma, :no_rich_text], user.info.no_rich_text)
+    |> Kernel.put_in([:source, :pleroma, :show_role], user.info.show_role)
+    |> Kernel.put_in([:source, :pleroma, :no_rich_text], user.info.no_rich_text)
   end
 
   defp maybe_put_settings(data, _, _, _), do: data