From 6995c2c496f0b8a55aa91700fbe033f6abe286c3 Mon Sep 17 00:00:00 2001 From: dms Date: Sat, 3 May 2003 11:03:11 +0000 Subject: [PATCH] - WOOPS. irc text counters code caught ALL QUERIES. FIXED git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@779 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/CommandStubs.pl | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/blootbot/src/CommandStubs.pl b/blootbot/src/CommandStubs.pl index 0a37f7c..0424249 100644 --- a/blootbot/src/CommandStubs.pl +++ b/blootbot/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 { -- 2.39.5