diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-10-05 23:31:49 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-10-05 23:31:49 +0000 |
commit | 3e751496e3d5f8c90d5e73d356bebb607d0edb44 (patch) | |
tree | dae870ed0729680017036150f0d3977ac9165de3 | |
parent | a71b82201365f92ad78ccec7f6f1ceda456eca4f (diff) | |
download | pleroma-3e751496e3d5f8c90d5e73d356bebb607d0edb44.tar.gz |
mastodon api: account view: fetch follow state and use it to populate `requested` field
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/account_view.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index 96795c420..d4d8ee2a5 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -72,6 +72,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do end def render("relationship.json", %{user: user, target: target}) do + follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target) + requested = follow_activity.data["state"] == "pending" + %{ id: to_string(target.id), following: User.following?(user, target), @@ -79,7 +82,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do blocking: User.blocks?(user, target), muting: false, muting_notifications: false, - requested: false, + requested: requested, domain_blocking: false, showing_reblogs: false, endorsed: false |