diff options
Diffstat (limited to 'app/models/form')
-rw-r--r-- | app/models/form/account_batch.rb | 18 | ||||
-rw-r--r-- | app/models/form/admin_settings.rb | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/app/models/form/account_batch.rb b/app/models/form/account_batch.rb index 26d6d3abf..698933c9f 100644 --- a/app/models/form/account_batch.rb +++ b/app/models/form/account_batch.rb @@ -21,6 +21,10 @@ class Form::AccountBatch approve! when 'reject' reject! + when 'suppress_follow_recommendation' + suppress_follow_recommendation! + when 'unsuppress_follow_recommendation' + unsuppress_follow_recommendation! end end @@ -79,4 +83,18 @@ class Form::AccountBatch records.each { |account| authorize(account.user, :reject?) } .each { |account| DeleteAccountService.new.call(account, reserve_email: false, reserve_username: false) } end + + def suppress_follow_recommendation! + authorize(:follow_recommendation, :suppress?) + + accounts.each do |account| + FollowRecommendationSuppression.create(account: account) + end + end + + def unsuppress_follow_recommendation! + authorize(:follow_recommendation, :unsuppress?) + + FollowRecommendationSuppression.where(account_id: account_ids).destroy_all + end end diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 999d835e6..558a906d2 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -35,7 +35,6 @@ class Form::AdminSettings mascot show_reblogs_in_public_timelines show_replies_in_public_timelines - spam_check_enabled trends trendable_by_default show_domain_blocks @@ -59,7 +58,6 @@ class Form::AdminSettings enable_keybase show_reblogs_in_public_timelines show_replies_in_public_timelines - spam_check_enabled trends trendable_by_default noindex |