Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
3e751496
Commit
3e751496
authored
Oct 05, 2018
by
kaniini
Browse files
mastodon api: account view: fetch follow state and use it to populate `requested` field
parent
a71b8220
Pipeline
#3933
failed with stages
in 5 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/mastodon_api/views/account_view.ex
View file @
3e751496
...
...
@@ -72,6 +72,9 @@ def render("mention.json", %{user: user}) 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 @@ def render("relationship.json", %{user: user, target: target}) do
blocking:
User
.
blocks?
(
user
,
target
),
muting:
false
,
muting_notifications:
false
,
requested:
false
,
requested:
requested
,
domain_blocking:
false
,
showing_reblogs:
false
,
endorsed:
false
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment