BlockValidator: Restore old behavior for incoming blocks.

This commit is contained in:
lain 2020-06-26 11:58:40 +02:00
commit c3383d4fab
3 changed files with 20 additions and 2 deletions

View file

@ -657,7 +657,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
describe "blocks" do
setup do
user = insert(:user)
user = insert(:user, local: false)
blocked = insert(:user)
{:ok, valid_block, []} = Builder.block(user, blocked)
@ -680,5 +680,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
assert {:error, _cng} = ObjectValidator.validate(block, [])
end
test "returns an error if don't accept remote blocks", %{valid_block: valid_block} do
clear_config([:activitypub, :unfollow_blocked], false)
assert {:error, _cng} = ObjectValidator.validate(valid_block, [])
end
end
end