revert subdomain change until i can look at why i did that
Some checks failed
ci/woodpecker/push/build-amd64 Pipeline is pending
ci/woodpecker/push/build-arm64 Pipeline is pending
ci/woodpecker/push/docs Pipeline is pending
ci/woodpecker/push/lint Pipeline is pending
ci/woodpecker/push/test Pipeline is pending
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test unknown status
ci/woodpecker/pr/build-arm64 unknown status
ci/woodpecker/pr/build-amd64 unknown status
ci/woodpecker/pr/docs unknown status

This commit is contained in:
Floatingghost 2024-06-15 15:14:42 +01:00
parent 4b765b1886
commit c0b2bba55e
2 changed files with 2 additions and 5 deletions

View file

@ -1629,9 +1629,8 @@ def blocks_domain?(%User{} = user, %User{ap_id: ap_id}) do
end
def blocks_domain?(%User{} = user, url) when is_binary(url) do
domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.domain_blocks)
%{host: host} = URI.parse(url)
Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, host)
%{host: host} = URI.parse(target.ap_id)
Enum.member?(user.domain_blocks, host)
end
def blocks_domain?(_, _), do: false

View file

@ -1177,8 +1177,6 @@ test "it unblocks domains" do
url = URI.parse(blocked_user.ap_id)
{:ok, user} = User.block_domain(user, url.host)
assert User.blocks_domain?(user, blocked_user)
{:ok, user} = User.unblock_domain(user, url.host)
refute User.blocks_domain?(user, blocked_user)