]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Question.pl
* New maxVolunteerLength to govern max size of non addressed replies
[infobot.git] / src / Factoids / Question.pl
index 71ae23c171d4156d0d7fb946a92b32dc542c913e..3fdccee7aa06fe6ffaae23cce76db205828c0f26 100644 (file)
@@ -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?