Merge pull request 'Federation: do not federate Undo Block when outgoing_blocks is off' (#8044) from lambadalambda/pleroma:fix/undo-block-outgoing-blocks into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/8044
This commit is contained in:
commit
d2b89f5723
3 changed files with 27 additions and 0 deletions
|
|
@ -338,6 +338,26 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
assert {:ok, :no_activity} == CommonAPI.unblock(blocked, blocker)
|
||||
refute User.blocks?(blocker, blocked)
|
||||
end
|
||||
|
||||
test "it unblocks and does not federate if outgoing blocks are disabled" do
|
||||
clear_config([:instance, :federating], true)
|
||||
clear_config([:activitypub, :outgoing_blocks], false)
|
||||
|
||||
blocked = insert(:user)
|
||||
blocker = insert(:user)
|
||||
|
||||
with_mock Pleroma.Web.Federator,
|
||||
publish: fn _ -> nil end do
|
||||
assert {:ok, block} = CommonAPI.block(blocked, blocker)
|
||||
assert block.local
|
||||
assert User.blocks?(blocker, blocked)
|
||||
|
||||
assert {:ok, unblock} = CommonAPI.unblock(blocked, blocker)
|
||||
assert unblock.local
|
||||
refute User.blocks?(blocker, blocked)
|
||||
assert_not_called(Pleroma.Web.Federator.publish(:_))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "deletion" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue