about summary refs log tree commit diff
path: root/app/models/report.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-03-21 03:08:09 +0100
committerGitHub <noreply@github.com>2020-03-21 03:08:09 +0100
commit61f35c1a8a7c6544fe82b733e40267f4b28a3264 (patch)
tree85ab4655e596a2c8e46f932099b82cbae9242f9a /app/models/report.rb
parentc39ad4ab2f0f821ea73720ebc1a7bec37ce6f58a (diff)
Fix reported accounts not being whitelisted when resolving a spamcheck report (#13289)
Diffstat (limited to 'app/models/report.rb')
-rw-r--r--app/models/report.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/report.rb b/app/models/report.rb
index fb2e040ee..356c23d68 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -59,6 +59,14 @@ class Report < ApplicationRecord
   end
 
   def resolve!(acting_account)
+    if account_id == -99 && target_account.trust_level == Account::TRUST_LEVELS[:untrusted]
+      # This is an automated report and it is being dismissed, so it's
+      # a false positive, in which case update the account's trust level
+      # to prevent further spam checks
+
+      target_account.update(trust_level: Account::TRUST_LEVELS[:trusted])
+    end
+
     RemovalWorker.push_bulk(Status.with_discarded.discarded.where(id: status_ids).pluck(:id)) { |status_id| [status_id, { immediate: true }] }
     update!(action_taken: true, action_taken_by_account_id: acting_account.id)
   end