This commit is contained in:
Robert R George 2024-05-17 14:03:41 +00:00 committed by GitHub
commit 85e844a8a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,15 @@ class FetchLinkCardService < BaseService
links.filter_map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.filter_map(&:normalize)
end
url_hosts = urls.map(&:host)
unless EmailDomainBlock.where(domain: url_hosts).empty?
@report = ReportService.new.call(
Account.representative,
@status.account,
comment: 'Automatically flagged for malicious or spam link', category: :spam, forward: false, status_ids: [@status.id]
)
end
urls.reject { |uri| bad_url?(uri) }.first
end