revert subdomain change until i can look at why i did that

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 @@ defmodule Pleroma.User do
end end
def blocks_domain?(%User{} = user, url) when is_binary(url) do 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(target.ap_id)
%{host: host} = URI.parse(url) Enum.member?(user.domain_blocks, host)
Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, host)
end end
def blocks_domain?(_, _), do: false def blocks_domain?(_, _), do: false

View file

@ -1177,8 +1177,6 @@ defmodule Pleroma.UserTest do
url = URI.parse(blocked_user.ap_id) url = URI.parse(blocked_user.ap_id)
{:ok, user} = User.block_domain(user, url.host) {:ok, user} = User.block_domain(user, url.host)
assert User.blocks_domain?(user, blocked_user)
{:ok, user} = User.unblock_domain(user, url.host) {:ok, user} = User.unblock_domain(user, url.host)
refute User.blocks_domain?(user, blocked_user) refute User.blocks_domain?(user, blocked_user)