revert subdomain change until i can look at why i did that
This commit is contained in:
parent
4b765b1886
commit
c0b2bba55e
2 changed files with 2 additions and 5 deletions
|
@ -1629,9 +1629,8 @@ def blocks_domain?(%User{} = user, %User{ap_id: ap_id}) 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
|
||||||
|
|
|
@ -1177,8 +1177,6 @@ test "it unblocks domains" 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)
|
||||||
|
|
Loading…
Reference in a new issue