From: dms Date: Sat, 3 May 2003 11:03:11 +0000 (+0000) Subject: - WOOPS. irc text counters code caught ALL QUERIES. FIXED X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=07ca114ebbb4aa4ac0860525f8386d42a47b2625 - WOOPS. irc text counters code caught ALL QUERIES. FIXED git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@779 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index 0a37f7c..0424249 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -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 {