fixes
This commit is contained in:
parent
b3580b6971
commit
16d896f526
@ -169,7 +169,7 @@ defmodule Pleroma.User do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@user_config Application.get_env(:pleroma, :user)
|
@user_config Application.get_env(:pleroma, :user)
|
||||||
@deny_follow_blocked Keyword.get(@ap_config, :deny_follow_blocked)
|
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)
|
||||||
|
|
||||||
def maybe_direct_follow(%User{} = follower, %User{info: info} = followed) do
|
def maybe_direct_follow(%User{} = follower, %User{info: info} = followed) do
|
||||||
user_info = user_info(followed)
|
user_info = user_info(followed)
|
||||||
@ -181,7 +181,7 @@ defmodule Pleroma.User do
|
|||||||
false
|
false
|
||||||
|
|
||||||
# if the users are blocking each other, we shouldn't even be here, but check for it anyway
|
# if the users are blocking each other, we shouldn't even be here, but check for it anyway
|
||||||
deny_follow_blocked and (User.blocks?(follower, followed) or User.blocks?(followed, follower)) ->
|
@deny_follow_blocked and (User.blocks?(follower, followed) or User.blocks?(followed, follower)) ->
|
||||||
false
|
false
|
||||||
|
|
||||||
# if OStatus, then there is no three-way handshake to follow
|
# if OStatus, then there is no three-way handshake to follow
|
||||||
@ -201,7 +201,7 @@ defmodule Pleroma.User do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@user_config Application.get_env(:pleroma, :user)
|
@user_config Application.get_env(:pleroma, :user)
|
||||||
@deny_follow_blocked Keyword.get(@ap_config, :deny_follow_blocked)
|
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)
|
||||||
|
|
||||||
def follow(%User{} = follower, %User{info: info} = followed) do
|
def follow(%User{} = follower, %User{info: info} = followed) do
|
||||||
ap_followers = followed.follower_address
|
ap_followers = followed.follower_address
|
||||||
@ -210,7 +210,7 @@ defmodule Pleroma.User do
|
|||||||
following?(follower, followed) or info["deactivated"] ->
|
following?(follower, followed) or info["deactivated"] ->
|
||||||
{:error, "Could not follow user: #{followed.nickname} is already on your list."}
|
{:error, "Could not follow user: #{followed.nickname} is already on your list."}
|
||||||
|
|
||||||
deny_follow_blocked and blocks?(followed, follower) ->
|
@deny_follow_blocked and blocks?(followed, follower) ->
|
||||||
{:error, "Could not follow user: #{followed.nickname} blocked you."}
|
{:error, "Could not follow user: #{followed.nickname} blocked you."}
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
|
@ -246,14 +246,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||||||
|
|
||||||
def block(blocker, blocked, activity_id \\ nil, local \\ true) do
|
def block(blocker, blocked, activity_id \\ nil, local \\ true) do
|
||||||
|
|
||||||
with true <- unfollow_blocked do
|
with true <- @unfollow_blocked do
|
||||||
follow_activity = fetch_latest_follow(blocker, blocked)
|
follow_activity = fetch_latest_follow(blocker, blocked)
|
||||||
if follow_activity do
|
if follow_activity do
|
||||||
unfollow(blocker, blocked, nil, local)
|
unfollow(blocker, blocked, nil, local)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
with true <- outgoing_blocks do
|
with true <- @outgoing_blocks do
|
||||||
with block_data <- make_block_data(blocker, blocked, activity_id),
|
with block_data <- make_block_data(blocker, blocked, activity_id),
|
||||||
{:ok, activity} <- insert(block_data, local),
|
{:ok, activity} <- insert(block_data, local),
|
||||||
:ok <- maybe_federate(activity) do
|
:ok <- maybe_federate(activity) do
|
||||||
|
Loading…
Reference in New Issue
Block a user