diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-04-20 18:06:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 18:06:40 +0200 |
commit | 97da7b73071e9f515c4bb0bca72c88d1a13b14aa (patch) | |
tree | 89c81064b9e3725962a847e98099a5b84b728733 /app/models/form | |
parent | df326b8b5c0659edb2aca77690a892f228b0e099 (diff) | |
parent | 4b115d070c9a8b6082ed207bd0a14e809eded322 (diff) |
Merge pull request #1521 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
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 |