mirror of
https://github.com/mastodon/mastodon.git
synced 2024-06-01 18:52:57 +00:00
Merge 3377d00a65
into 2da2a1dae9
This commit is contained in:
commit
85e844a8a3
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue