about summary refs log tree commit diff
path: root/app/models/admin
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/models/admin
parentb3dd0d276d52042828e11bf325015f5d7f4624ca (diff)
parent877e8c9d799eae663526609642e0c0c9a4612bda (diff)
Merge pull request #1233 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/admin')
-rw-r--r--app/models/admin/account_action.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb
index b30a82369..e9da003a3 100644
--- a/app/models/admin/account_action.rb
+++ b/app/models/admin/account_action.rb
@@ -62,6 +62,8 @@ class Admin::AccountAction
 
   def process_action!
     case type
+    when 'none'
+      handle_resolve!
     when 'disable'
       handle_disable!
     when 'silence'
@@ -103,6 +105,16 @@ class Admin::AccountAction
     end
   end
 
+  def handle_resolve!
+    if with_report? && report.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
+  end
+
   def handle_disable!
     authorize(target_account.user, :disable?)
     log_action(:disable, target_account.user)