mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
mastodon api: account view: fetch follow state and use it to populate requested
field
This commit is contained in:
parent
a71b822013
commit
3e751496e3
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue