move configurable module attributes into relevant functions
This commit is contained in:
parent
63946a6af3
commit
4e099fcfa9
@ -168,10 +168,10 @@ defmodule Pleroma.User do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def maybe_direct_follow(%User{} = follower, %User{info: info} = followed) do
|
||||||
@user_config Application.get_env(:pleroma, :user)
|
@user_config Application.get_env(:pleroma, :user)
|
||||||
@deny_follow_blocked Keyword.get(@user_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
|
|
||||||
user_info = user_info(followed)
|
user_info = user_info(followed)
|
||||||
|
|
||||||
should_direct_follow =
|
should_direct_follow =
|
||||||
@ -209,10 +209,10 @@ defmodule Pleroma.User do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def follow(%User{} = follower, %User{info: info} = followed) do
|
||||||
@user_config Application.get_env(:pleroma, :user)
|
@user_config Application.get_env(:pleroma, :user)
|
||||||
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)
|
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)
|
||||||
|
|
||||||
def follow(%User{} = follower, %User{info: info} = followed) do
|
|
||||||
ap_followers = followed.follower_address
|
ap_followers = followed.follower_address
|
||||||
|
|
||||||
cond do
|
cond do
|
||||||
|
@ -242,11 +242,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def block(blocker, blocked, activity_id \\ nil, local \\ true) do
|
||||||
@ap_config Application.get_env(:pleroma, :activitypub)
|
@ap_config Application.get_env(:pleroma, :activitypub)
|
||||||
@unfollow_blocked Keyword.get(@ap_config, :unfollow_blocked)
|
@unfollow_blocked Keyword.get(@ap_config, :unfollow_blocked)
|
||||||
@outgoing_blocks Keyword.get(@ap_config, :outgoing_blocks)
|
@outgoing_blocks Keyword.get(@ap_config, :outgoing_blocks)
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user