about summary refs log tree commit diff
path: root/app/models/admin/account_action.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-11-07 18:19:34 +0100
committerThibaut Girka <thib@sitedethib.com>2020-11-07 18:23:02 +0100
commit412218af2ecd4cd004708d781e574208742dea4c (patch)
treec0bf823109c7481ec9242a0263e091ec4aaeafeb /app/models/admin/account_action.rb
parent5a9fc749c3eab8d3c93dd282fa89c20a5cb0e994 (diff)
parentee8cf246cfe8e05914ad7dcf81596f8535b3e161 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models/admin/account_action.rb')
-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 c4ac09520..11ce737f3 100644
--- a/app/models/admin/account_action.rb
+++ b/app/models/admin/account_action.rb
@@ -8,6 +8,7 @@ class Admin::AccountAction
   TYPES = %w(
     none
     disable
+    sensitive
     silence
     suspend
   ).freeze
@@ -64,6 +65,8 @@ class Admin::AccountAction
     case type
     when 'disable'
       handle_disable!
+    when 'sensitive'
+      handle_sensitive!
     when 'silence'
       handle_silence!
     when 'suspend'
@@ -109,6 +112,12 @@ class Admin::AccountAction
     target_account.user&.disable!
   end
 
+  def handle_sensitive!
+    authorize(target_account, :sensitive?)
+    log_action(:sensitive, target_account)
+    target_account.sensitize!
+  end
+
   def handle_silence!
     authorize(target_account, :silence?)
     log_action(:silence, target_account)