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)