|
|
@ -44,7 +44,6 @@ class SpamCheck
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def flag!
|
|
|
|
def flag!
|
|
|
|
auto_silence_account!
|
|
|
|
|
|
|
|
auto_report_status!
|
|
|
|
auto_report_status!
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -134,17 +133,13 @@ class SpamCheck
|
|
|
|
text.gsub(/\s+/, ' ').strip
|
|
|
|
text.gsub(/\s+/, ' ').strip
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def auto_silence_account!
|
|
|
|
|
|
|
|
@account.silence!
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def auto_report_status!
|
|
|
|
def auto_report_status!
|
|
|
|
status_ids = Status.where(visibility: %i(public unlisted)).where(id: matching_status_ids).pluck(:id) + [@status.id] if @status.distributable?
|
|
|
|
status_ids = Status.where(visibility: %i(public unlisted)).where(id: matching_status_ids).pluck(:id) + [@status.id] if @status.distributable?
|
|
|
|
ReportService.new.call(Account.representative, @account, status_ids: status_ids, comment: I18n.t('spam_check.spam_detected_and_silenced'))
|
|
|
|
ReportService.new.call(Account.representative, @account, status_ids: status_ids, comment: I18n.t('spam_check.spam_detected_and_silenced'))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def already_flagged?
|
|
|
|
def already_flagged?
|
|
|
|
@account.silenced?
|
|
|
|
@account.silenced? || @account.targeted_reports.unresolved.where(account_id: -99).exists?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def trusted?
|
|
|
|
def trusted?
|
|
|
|