[Pleroma.Web.MastodonAPI.AccountView]: Add bot field

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-10 01:44:38 +02:00
commit d008f2d69c
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 40 additions and 0 deletions

View file

@ -13,6 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
image = User.avatar_url(user) |> MediaProxy.url()
header = User.banner_url(user) |> MediaProxy.url()
user_info = User.user_info(user)
bot = (user.info["source_data"]["type"] || "Person") in ["Application", "Service"]
emojis =
(user.info["source_data"]["tag"] || [])
@ -44,6 +45,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
header_static: header,
emojis: emojis,
fields: [],
bot: bot,
source: %{
note: "",
privacy: "public",