about summary refs log tree commit diff
path: root/app/lib/spam_check.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-10-11 22:28:11 +0200
committerGitHub <noreply@github.com>2019-10-11 22:28:11 +0200
commitef925f31a66d1cbc95bff11669d05e2924d8ce85 (patch)
treeaadbb60d22a196075fe1faaeeae169e5badead57 /app/lib/spam_check.rb
parentb3dd0d276d52042828e11bf325015f5d7f4624ca (diff)
parent877e8c9d799eae663526609642e0c0c9a4612bda (diff)
Merge pull request #1233 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/spam_check.rb')
-rw-r--r--app/lib/spam_check.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/lib/spam_check.rb b/app/lib/spam_check.rb
index 441697364..235e44230 100644
--- a/app/lib/spam_check.rb
+++ b/app/lib/spam_check.rb
@@ -44,7 +44,6 @@ class SpamCheck
   end
 
   def flag!
-    auto_silence_account!
     auto_report_status!
   end
 
@@ -134,17 +133,13 @@ class SpamCheck
     text.gsub(/\s+/, ' ').strip
   end
 
-  def auto_silence_account!
-    @account.silence!
-  end
-
   def auto_report_status!
     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'))
   end
 
   def already_flagged?
-    @account.silenced?
+    @account.silenced? || @account.targeted_reports.unresolved.where(account_id: -99).exists?
   end
 
   def trusted?