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
33beb51d
Commit
33beb51d
authored
Nov 03, 2017
by
lain
Browse files
MastoAPI: Add blocking to AccountView.
parent
9b63647a
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/mastodon_api/views/account_view.ex
View file @
33beb51d
...
...
@@ -55,7 +55,7 @@ def render("relationship.json", %{user: user, target: target}) do
id:
target
.
id
,
following:
User
.
following?
(
user
,
target
),
followed_by:
User
.
following?
(
target
,
user
),
blocking:
false
,
blocking:
User
.
blocks?
(
user
,
target
)
,
muting:
false
,
requested:
false
,
domain_blocking:
false
...
...
test/web/mastodon_api/account_view_test.exs
View file @
33beb51d
...
...
@@ -51,12 +51,13 @@ test "represent a relationship" do
other_user
=
insert
(
:user
)
{
:ok
,
user
}
=
User
.
follow
(
user
,
other_user
)
{
:ok
,
user
}
=
User
.
block
(
user
,
other_user
)
expected
=
%{
id:
other_user
.
id
,
following:
true
,
followed_by:
false
,
blocking:
fals
e
,
blocking:
tru
e
,
muting:
false
,
requested:
false
,
domain_blocking:
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