From: kaniini Date: Mon, 3 Sep 2018 12:33:36 +0000 (+0000) Subject: Merge branch 'feature/mastodon_api_2.4.x' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=1c9e539b47ff594d75c9548a04e64cb0c61cff8c;p=akkoma Merge branch 'feature/mastodon_api_2.4.x' into 'develop' Add/Fix Mastodon endpoints for 2.4.3 compatibility See merge request pleroma/pleroma!266 --- 1c9e539b47ff594d75c9548a04e64cb0c61cff8c diff --cc lib/pleroma/web/mastodon_api/views/account_view.ex index 7bc32e688,634985fb6..85aac493f --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@@ -26,9 -27,14 +27,14 @@@ defmodule Pleroma.Web.MastodonAPI.Accou } end) + fields = + (user.info["source_data"]["attachment"] || []) + |> Enum.filter(fn %{"type" => t} -> t == "PropertyValue" end) + |> Enum.map(fn fields -> Map.take(fields, ["name", "value"]) end) + %{ id: to_string(user.id), - username: hd(String.split(user.nickname, "@")), + username: username_from_nickname(user.nickname), acct: user.nickname, display_name: user.name || user.nickname, locked: user_info.locked, @@@ -43,10 -49,11 +49,11 @@@ header: header, header_static: header, emojis: emojis, - fields: [], + fields: fields, + bot: bot, source: %{ note: "", - privacy: "public", + privacy: user_info.default_scope, sensitive: "false" } }