From d62f2b4d6742f02a2f602dfb855c8fe91662ac74 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 15 Jun 2016 13:18:54 -0400 Subject: [PATCH] UX: rename setting num_flags_to_block_new_user to num_spam_flags_to_block_new_user --- app/services/spam_rule/auto_block.rb | 4 ++-- config/locales/server.en.yml | 4 ++-- config/site_settings.yml | 2 +- spec/integration/spam_rules_spec.rb | 2 +- spec/services/auto_block_spec.rb | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/services/spam_rule/auto_block.rb b/app/services/spam_rule/auto_block.rb index 2a3f83e4504..a44ac9a115a 100644 --- a/app/services/spam_rule/auto_block.rb +++ b/app/services/spam_rule/auto_block.rb @@ -21,9 +21,9 @@ class SpamRule::AutoBlock return false if @user.staged? return false if @user.has_trust_level?(TrustLevel[1]) - if SiteSetting.num_flags_to_block_new_user > 0 and + if SiteSetting.num_spam_flags_to_block_new_user > 0 and SiteSetting.num_users_to_block_new_user > 0 and - num_spam_flags_against_user >= SiteSetting.num_flags_to_block_new_user and + num_spam_flags_against_user >= SiteSetting.num_spam_flags_to_block_new_user and num_users_who_flagged_spam_against_user >= SiteSetting.num_users_to_block_new_user return true end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7f2a04b795c..b695310072c 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -885,8 +885,8 @@ en: tl3_additional_likes_per_day_multiplier: "Increase limit of likes per day for tl3 (regular) by multiplying with this number" tl4_additional_likes_per_day_multiplier: "Increase limit of likes per day for tl4 (leader) by multiplying with this number" - num_flags_to_block_new_user: "If a new user's posts get this many spam flags from num_users_to_block_new_user different users, hide all their posts and prevent future posting. 0 to disable." - num_users_to_block_new_user: "If a new user's posts get num_flags_to_block_new_user spam flags from this many different users, hide all their posts and prevent future posting. 0 to disable." + num_spam_flags_to_block_new_user: "If a new user's posts get this many spam flags from num_users_to_block_new_user different users, hide all their posts and prevent future posting. 0 to disable." + num_users_to_block_new_user: "If a new user's posts get num_spam_flags_to_block_new_user spam flags from this many different users, hide all their posts and prevent future posting. 0 to disable." num_tl3_flags_to_block_new_user: "If a new user's posts get this many flags from num_tl3_users_to_block_new_user different trust level 3 users, hide all their posts and prevent future posting. 0 to disable." num_tl3_users_to_block_new_user: "If a new user's posts get num_tl3_flags_to_block_new_user flags from this many different trust level 3 users, hide all their posts and prevent future posting. 0 to disable." notify_mods_when_user_blocked: "If a user is automatically blocked, send a message to all moderators." diff --git a/config/site_settings.yml b/config/site_settings.yml index a1dad349973..d3b255bcf30 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -776,7 +776,7 @@ spam: add_rel_nofollow_to_user_content: true flags_required_to_hide_post: 3 cooldown_minutes_after_hiding_posts: 10 - num_flags_to_block_new_user: 3 + num_spam_flags_to_block_new_user: 3 num_users_to_block_new_user: 3 num_tl3_flags_to_block_new_user: 6 num_tl3_users_to_block_new_user: 4 diff --git a/spec/integration/spam_rules_spec.rb b/spec/integration/spam_rules_spec.rb index 04f8b41ee06..1a637d8b7b9 100644 --- a/spec/integration/spam_rules_spec.rb +++ b/spec/integration/spam_rules_spec.rb @@ -7,7 +7,7 @@ describe SpamRulesEnforcer do describe 'auto-blocking users based on flagging' do before do SiteSetting.stubs(:flags_required_to_hide_post).returns(0) # never - SiteSetting.stubs(:num_flags_to_block_new_user).returns(2) + SiteSetting.stubs(:num_spam_flags_to_block_new_user).returns(2) SiteSetting.stubs(:num_users_to_block_new_user).returns(2) end diff --git a/spec/services/auto_block_spec.rb b/spec/services/auto_block_spec.rb index 3ce4630462a..b2216973de5 100644 --- a/spec/services/auto_block_spec.rb +++ b/spec/services/auto_block_spec.rb @@ -4,7 +4,7 @@ describe SpamRule::AutoBlock do before do SiteSetting.flags_required_to_hide_post = 0 # never - SiteSetting.num_flags_to_block_new_user = 2 + SiteSetting.num_spam_flags_to_block_new_user = 2 SiteSetting.num_users_to_block_new_user = 2 end @@ -228,8 +228,8 @@ describe SpamRule::AutoBlock do expect(subject.block?).to be_falsey end - it 'returns false if num_flags_to_block_new_user is 0' do - SiteSetting.num_flags_to_block_new_user = 0 + it 'returns false if num_spam_flags_to_block_new_user is 0' do + SiteSetting.num_spam_flags_to_block_new_user = 0 subject.stubs(:num_spam_flags_against_user).returns(100) subject.stubs(:num_users_who_flagged_spam_against_user).returns(100) expect(subject.block?).to be_falsey