From c0b2bba55e295437a71ee18c669254d4926cf017 Mon Sep 17 00:00:00 2001 From: Floatingghost Date: Sat, 15 Jun 2024 15:14:42 +0100 Subject: [PATCH] revert subdomain change until i can look at why i did that --- lib/pleroma/user.ex | 5 ++--- test/pleroma/user_test.exs | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index ee510b4b1..223b12223 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -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 diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 38cbe824d..e3f0bb415 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -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)