]> git.donarmstrong.com Git - infobot.git/commitdiff
- WOOPS. irc text counters code caught ALL QUERIES. FIXED
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 3 May 2003 11:03:11 +0000 (11:03 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 3 May 2003 11:03:11 +0000 (11:03 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@779 c11ca15a-4712-0410-83d8-924469b57eb5

src/CommandStubs.pl

index 0a37f7ca514693cfff9a47a1476f331ef5c5345b..042424939cfc6002a77c7205a067ad55c0ef4b55 100644 (file)
@@ -308,10 +308,8 @@ sub Modules {
     my $itc;
     $itc = &getChanConf("ircTextCounters");
     $itc = &findChanConf("ircTextCounters") unless ($itc);
-    if ($itc) {
-       &do_text_counters($itc);
-       return;
-    }
+    return if ($itc && &do_text_counters($itc) == 1);
+    # end of text counters.
 
     # list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
     if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
@@ -820,7 +818,7 @@ sub do_text_counters {
 
     if ($message =~ /^_stats(\s+(\S+))$/i) {
        &textstats_main($2);
-       return;
+       return 1;
     }
 
     my ($type,$arg);
@@ -828,7 +826,7 @@ sub do_text_counters {
        $type = $1;
        $arg  = $3;
     } else {
-       return;
+       return 0;
     }
 
     # even more uglier with channel/time arguments.
@@ -882,7 +880,7 @@ sub do_text_counters {
 
        if (!defined $x) {      # !defined.
            &pSReply("$arg has not said $type yet.");
-           return;
+           return 1;
        }
 
        # defined.
@@ -910,10 +908,7 @@ sub do_text_counters {
        &pSReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
     }
 
-    if ($@) {
-       &DEBUG("regex failed: $@");
-       return;
-    }
+    return 1;
 }
 
 sub textstats_main {