Bladeren bron

move configurable module attributes into relevant functions

tags/v0.9.9
squidboi 6 jaren geleden
bovenliggende
commit
4e099fcfa9
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: 18925A9B65D2457
2 gewijzigde bestanden met toevoegingen van 10 en 10 verwijderingen
  1. +6
    -6
      lib/pleroma/user.ex
  2. +4
    -4
      lib/pleroma/web/activity_pub/activity_pub.ex

+ 6
- 6
lib/pleroma/user.ex Bestand weergeven

@@ -168,10 +168,10 @@ defmodule Pleroma.User do
end
end

@user_config Application.get_env(:pleroma, :user)
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)

def maybe_direct_follow(%User{} = follower, %User{info: info} = followed) do
@user_config Application.get_env(:pleroma, :user)
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)

user_info = user_info(followed)

should_direct_follow =
@@ -209,10 +209,10 @@ defmodule Pleroma.User do
end
end

@user_config Application.get_env(:pleroma, :user)
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)

def follow(%User{} = follower, %User{info: info} = followed) do
@user_config Application.get_env(:pleroma, :user)
@deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked)

ap_followers = followed.follower_address

cond do


+ 4
- 4
lib/pleroma/web/activity_pub/activity_pub.ex Bestand weergeven

@@ -242,11 +242,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end

@ap_config Application.get_env(:pleroma, :activitypub)
@unfollow_blocked Keyword.get(@ap_config, :unfollow_blocked)
@outgoing_blocks Keyword.get(@ap_config, :outgoing_blocks)

def block(blocker, blocked, activity_id \\ nil, local \\ true) do
@ap_config Application.get_env(:pleroma, :activitypub)
@unfollow_blocked Keyword.get(@ap_config, :unfollow_blocked)
@outgoing_blocks Keyword.get(@ap_config, :outgoing_blocks)

with true <- @unfollow_blocked do
follow_activity = fetch_latest_follow(blocker, blocked)



Laden…
Annuleren
Opslaan