From 3b06175e8f5cb9d688e8ec376dbfd88abf5f3278 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 10 May 2019 03:48:11 -0500 Subject: Moderation: add `force sensitive` and `force unlisted` actions. Accounts: add federatable `adult content` tag. Handle from remote accounts as well. --- app/models/admin/account_action.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/models/admin/account_action.rb') diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb index 84c3f880d..1ed464423 100644 --- a/app/models/admin/account_action.rb +++ b/app/models/admin/account_action.rb @@ -8,6 +8,8 @@ class Admin::AccountAction TYPES = %w( none disable + force_sensitive + force_unlisted silence suspend ).freeze @@ -56,6 +58,10 @@ class Admin::AccountAction case type when 'disable' handle_disable! + when 'force_sensitive' + handle_force_sensitive! + when 'force_unlisted' + handle_force_unlisted! when 'silence' handle_silence! when 'suspend' @@ -97,6 +103,18 @@ class Admin::AccountAction target_account.user&.disable! end + def handle_force_sensitive! + authorize(target_account, :force_sensitive?) + log_action(:force_sensitive, target_account.user) + target_account.force_sensitive! + end + + def handle_force_unlisted! + authorize(target_account, :force_unlisted?) + log_action(:force_unlisted, target_account.user) + target_account.force_unlisted! + end + def handle_silence! authorize(target_account, :silence?) log_action(:silence, target_account) -- cgit