about summary refs log tree commit diff
path: root/app/models/admin
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-17 02:26:52 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-17 02:26:52 -0600
commit2427cced78580da729a0ac6a1dc52b2d206aa11c (patch)
treee0b703674d3a1fb523b447eb512ff0b2ac6ddd65 /app/models/admin
parent8bf7e00362b4e5bf29e3841bd871590871b5257d (diff)
add a `manual_only` (manual trust only) moderation option + handle more `reject_unknown`/graylist mode caveats
Diffstat (limited to 'app/models/admin')
-rw-r--r--app/models/admin/account_action.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb
index cb6b4715a..9789cb553 100644
--- a/app/models/admin/account_action.rb
+++ b/app/models/admin/account_action.rb
@@ -13,6 +13,7 @@ class Admin::AccountAction
     silence
     suspend
     mark_unknown
+    manual_only
   ).freeze
 
   attr_accessor :target_account,
@@ -69,6 +70,8 @@ class Admin::AccountAction
       handle_suspend!
     when 'mark_unknown'
       handle_mark_unknown!
+    when 'manual_only'
+      handle_manual_only!
     end
   end
 
@@ -137,6 +140,12 @@ class Admin::AccountAction
     target_account.mark_unknown!
   end
 
+  def handle_manual_only!
+    authorize(target_account, :manual_only?)
+    log_action(:manual_only, target_account)
+    target_account.manual_only!
+  end
+
   def text_for_warning
     [warning_preset&.text, text].compact.join("\n\n")
   end