Skip to content
GitLab
Menu
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
fc3bcf33
Commit
fc3bcf33
authored
Nov 18, 2018
by
lain
Browse files
Fix following locked users.
parent
d5af41b5
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
fc3bcf33
...
...
@@ -191,7 +191,7 @@ def needs_update?(%User{local: false} = user) do
def
needs_update?
(
_
),
do
:
true
def
maybe_direct_follow
(%
User
{}
=
follower
,
%
User
{
local:
true
,
info:
%{
"
locked
"
=>
true
}})
do
def
maybe_direct_follow
(%
User
{}
=
follower
,
%
User
{
local:
true
,
info:
%{
locked
:
true
}})
do
{
:ok
,
follower
}
end
...
...
test/user_test.exs
View file @
fc3bcf33
...
...
@@ -56,8 +56,8 @@ test "can't follow a user who blocked us" do
end
test
"local users do not automatically follow local locked accounts"
do
follower
=
insert
(
:user
,
info:
%{
"
locked
"
=>
true
})
followed
=
insert
(
:user
,
info:
%{
"
locked
"
=>
true
})
follower
=
insert
(
:user
,
info:
%{
locked
:
true
})
followed
=
insert
(
:user
,
info:
%{
locked
:
true
})
{
:ok
,
follower
}
=
User
.
maybe_direct_follow
(
follower
,
followed
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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