From 0a238f34b39b606d5f20e1ef1fbdd2a8c56951db Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 22 Jun 2019 00:13:10 +0200 Subject: port tootsuite#11138 to monsterfork: Change domain blocks to automatically support subdomains * Change domain blocks to automatically support subdomains If a more authoritative domain is blocked (example.com), then the same block will be applied to a subdomain (foo.example.com) * Match subdomains of existing accounts when blocking/unblocking domains * Improve code style --- app/services/block_domain_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/services/block_domain_service.rb') diff --git a/app/services/block_domain_service.rb b/app/services/block_domain_service.rb index 36634fdd5..8ec77ce82 100644 --- a/app/services/block_domain_service.rb +++ b/app/services/block_domain_service.rb @@ -123,7 +123,7 @@ class BlockDomainService < BaseService end def blocked_domain_accounts - Account.where(domain: blocked_domain).reorder(nil) + Account.by_domain_and_subdomains(blocked_domain) end def media_from_blocked_domain @@ -131,7 +131,7 @@ class BlockDomainService < BaseService end def emojis_from_blocked_domains - CustomEmoji.where(domain: blocked_domain) + CustomEmoji.by_domain_and_subdomains(blocked_domain) end def unknown_accounts -- cgit