FIX: always allow tl1 through for typing speed tests

This commit is contained in:
Sam
2015-08-06 10:07:07 +10:00
parent dbd6099b89
commit 11d39345b3
2 changed files with 34 additions and 6 deletions
+8 -6
View File
@@ -32,15 +32,19 @@ class NewPostManager
user = manager.user
args = manager.args
args[:first_post_checks] &&
user.post_count == 0
!!(
args[:first_post_checks] &&
user.post_count == 0
)
end
def self.is_fast_typer?(manager)
args = manager.args
is_first_post?(manager) &&
args[:typing_duration_msecs].to_i < SiteSetting.min_first_post_typing_time
args[:typing_duration_msecs].to_i < SiteSetting.min_first_post_typing_time &&
SiteSetting.auto_block_fast_typers_on_first_post &&
manager.user.trust_level <= SiteSetting.auto_block_fast_typers_max_trust_level
end
def self.matches_auto_block_regex?(manager)
@@ -78,9 +82,7 @@ class NewPostManager
result = manager.enqueue('default')
block = is_fast_typer?(manager) &&
SiteSetting.auto_block_fast_typers_on_first_post &&
SiteSetting.auto_block_fast_typers_max_trust_level <= manager.user.trust_level
block = is_fast_typer?(manager)
block ||= matches_auto_block_regex?(manager)