Do not federate undo->block activities
the :do_not_federate checks were omitted from the undo pipeline, which could lead to them federating. this commit enforces :outgoing_blocks on undos as well - and any existing value of :do_not_federate is preserved, if one exists Akkoma issue 957. [Pleroma: block/unblock test calls use the Pleroma (blocked, blocker) argument order.] (cherry picked from commit eca7ed572b8a10a0235fb1a381eac4803614dee4)
This commit is contained in:
parent
3e9dc477c9
commit
06612c802b
2 changed files with 26 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