X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=blobdiff_plain;f=src%2FFactoids%2FQuestion.pl;h=3fdccee7aa06fe6ffaae23cce76db205828c0f26;hp=71ae23c171d4156d0d7fb946a92b32dc542c913e;hb=ab817c7c909abba1654f3b8691961ec8694e8169;hpb=1b325d96346dbd17a6c8c2a99bdd63ddb6ab70f7 diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index 71ae23c..3fdccee 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -23,7 +23,6 @@ sub doQuestion { local ($query) = @_; local ($reply) = ''; local $finalQMark = $query =~ s/\?+\s*$//; - $finalQMark += $query =~ s/\?\s*$//; $query =~ s/^\s+|\s+$//g; if ( !defined $query or $query =~ /^\s*$/ ) { @@ -34,8 +33,16 @@ sub doQuestion { if ( !$addressed ) { return '' unless ($finalQMark); - return '' unless &IsChanConf('minVolunteerLength') > 0; - return '' if ( length $query < &::getChanConf('minVolunteerLength') ); + return '' + if ( + length $query < + &::getChanConfDefault( 'minVolunteerLength', 2, $chan ) or + $param{'addressing'} =~ m/require/i ); + return '' + if ( + length $query > + &::getChanConfDefault( 'maxVolunteerLength', 512, $chan ) or + $param{'addressing'} =~ m/require/i ); } else { ### TODO: this should be caught in Process.pl?