end
end
- @ap_config Application.get_env(:pleroma, :activitypub)
- @accept_blocks Keyword.get(@ap_config, :accept_blocks)
-
def handle_incoming(
%{
"type" => "Undo",
"id" => id
} = _data
) do
- with true <- @accept_blocks,
+ with true <- Pleroma.Config.get([:activitypub, :accept_blocks]),
%User{local: true} = blocked <- User.get_cached_by_ap_id(blocked),
%User{} = blocker <- User.get_or_fetch_by_ap_id(blocker),
{:ok, activity} <- ActivityPub.unblock(blocker, blocked, id, false) do
def handle_incoming(
%{"type" => "Block", "object" => blocked, "actor" => blocker, "id" => id} = data
) do
- with true <- @accept_blocks,
+ with true <- Pleroma.Config.get([:activitypub, :accept_blocks]),
%User{local: true} = blocked = User.get_cached_by_ap_id(blocked),
%User{} = blocker = User.get_or_fetch_by_ap_id(blocker),
{:ok, activity} <- ActivityPub.block(blocker, blocked, id, false) do