mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 08:13:43 +08:00
UX: rename setting num_flags_to_block_new_user to num_spam_flags_to_block_new_user
This commit is contained in:
parent
169d17edc3
commit
d62f2b4d67
|
@ -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
|
||||
|
|
|
@ -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."
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user