Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2022-02-26 17:27:17 +01:00
commit 67c6f37e26
2 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,8 @@ module Admin
log_action :create, @email_domain_block log_action :create, @email_domain_block
(@email_domain_block.other_domains || []).uniq.each do |domain| (@email_domain_block.other_domains || []).uniq.each do |domain|
next if EmailDomainBlock.where(domain: domain).exists?
other_email_domain_block = EmailDomainBlock.create!(domain: domain, parent: @email_domain_block) other_email_domain_block = EmailDomainBlock.create!(domain: domain, parent: @email_domain_block)
log_action :create, other_email_domain_block log_action :create, other_email_domain_block
end end

View File

@ -15,7 +15,8 @@ class Scheduler::EmailDomainBlockRefreshScheduler
if ip?(email_domain_block.domain) if ip?(email_domain_block.domain)
[email_domain_block.domain] [email_domain_block.domain]
else else
dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::A).to_a + dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::AAAA).to_a.map { |resource| resource.address.to_s } resources = dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::A).to_a + dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::AAAA).to_a
resources.map { |resource| resource.address.to_s }
end end
end end