]> git.donarmstrong.com Git - infobot.git/commitdiff
s/hasParam/IsChanConfOrWarn/
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 18 Feb 2005 03:32:04 +0000 (03:32 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 18 Feb 2005 03:32:04 +0000 (03:32 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1140 c11ca15a-4712-0410-83d8-924469b57eb5

scripts/findparam.pl
src/CommandStubs.pl
src/Misc.pl
src/Modules/UserDCC.pl
src/Process.pl
src/UserExtra.pl

index d079e201550a613a2ab56fe0ef420c7dbdb5c37c..077cac5d5f8afd0dd53909a972504be3faee2cbe 100644 (file)
@@ -19,8 +19,8 @@ foreach (`find -name "*.pl"`) {
            next;
        }
 
-       if (/hasParam\(['"](\S+?)['"]\)/) {
-           print "File: $file: hasParam: $1\n" if $debug;
+       if (/IsChanConfOrWarn\(['"](\S+?)['"]\)/) {
+           print "File: $file: IsChanConfOrWarn: $1\n" if $debug;
            $param{$1}++;
            next;
        }
@@ -43,7 +43,7 @@ foreach (`find -name "*.pl"`) {
            next;
        }
 
-       # command hooks => hasParam => both.
+       # command hooks => IsChanConfOrWarn => both.
        # note: this does not support multiple lines.
        if (/\'Identifier\'[\s\t]=>[\s\t]+\'(\S+?)\'/) {
            print "File: $file: command hook: $1\n" if $debug;
index 054d02f74fac2bb1d3ae0480633d777877a76c1f..eb8e7df4adcbe0395d27f16a947c53ae5817fc27 100644 (file)
@@ -104,7 +104,7 @@ sub parseCmdHook {
 
        ### IDENTIFIER.
        if (exists $hash{'Identifier'}) {
-           return 1 unless (&hasParam($hash{'Identifier'}));
+           return 1 unless (&IsChanConfOrWarn($hash{'Identifier'}));
        }
 
        ### USER FLAGS.
@@ -298,7 +298,7 @@ sub Modules {
     $debiancmd         .= '|recommends?|suggests?|maint|maintainer';
 
     if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
-       return unless (&hasParam('Debian'));
+       return unless (&IsChanConfOrWarn('Debian'));
        my $package = lc $3;
 
        if (defined $package) {
@@ -312,7 +312,7 @@ sub Modules {
 
     # google searching. Simon++
     if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
-       return unless (&hasParam('W3Search'));
+       return unless (&IsChanConfOrWarn('W3Search'));
 
        &Forker('W3Search', sub { &W3Search::W3Search($1,$2); } );
 
@@ -329,7 +329,7 @@ sub Modules {
 
     # list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
     if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
-       return unless (&hasParam('Search'));
+       return unless (&IsChanConfOrWarn('Search'));
 
        my $thiscmd     = lc $1;
        my $args        = $3 || "";
@@ -362,7 +362,7 @@ sub Modules {
 
     # Nickometer. Adam Spiers++
     if ($message =~ /^(?:lame|nick)ometer(?: for)? (\S+)/i) {
-       return unless (&hasParam("nickometer"));
+       return unless (&IsChanConfOrWarn("nickometer"));
 
        my $term = (lc $1 eq 'me') ? $who : $1;
 
@@ -425,7 +425,7 @@ sub Modules {
     # Topic management. xk++
     # may want to add a userflags for topic. -xk
     if ($message =~ /^topic(\s+(.*))?$/i) {
-       return unless (&hasParam('Topic'));
+       return unless (&IsChanConfOrWarn('Topic'));
 
        my $chan        = $talkchannel;
        my @args        = split / /, $2 || "";
@@ -472,7 +472,7 @@ sub Modules {
 
     # wingate.
     if ($message =~ /^wingate$/i) {
-       return unless (&hasParam('Wingate'));
+       return unless (&IsChanConfOrWarn('Wingate'));
 
        my $reply = "Wingate statistics: scanned \002"
                        .scalar(keys %wingate)."\002 hosts";
index 30222f406a7c2ffff6e7fd151342114b7a92959a..df95bc9f18a39f18f1b254f98bc7ba9599e0fc07 100644 (file)
@@ -585,10 +585,10 @@ sub hasProfanity {
     return $profanity;
 }
 
-sub hasParam {
+sub IsChanConfOrWarn {
     my ($param) = @_;
 
-    if (&IsChanConf($param) or &IsParam($param)) {
+    if (&IsChanConf($param)) {
        return 1;
     } else {
        ### TODO: specific reason why it failed.
index cec6291d4c12c5c6caff4e5db8c0b03e663e53cd..da76b6edd2066fb668ff0f71dca0f0bfa241dcd0 100644 (file)
@@ -105,7 +105,7 @@ sub userDCC {
     # backlog.
     if ($message =~ /^backlog(\s+(.*))?$/i) {
        return unless (&hasFlag("o"));
-       return unless (&hasParam("backlog"));
+       return unless (&IsChanConfOrWarn("backlog"));
        my $num = $2;
        my $max = $param{'backlog'};
 
index 84387ec828dfde37c059805d23a7fd85e9e1a881..33c1d37e932821f610e3e6aeecd8cf489558999a 100644 (file)
@@ -298,7 +298,7 @@ sub process {
 
     # karma. set...
     if ($msgType =~ /public/i && $message =~ /^(\S+)(--|\+\+)\s*$/ &&
-       $addressed && &hasParam("karma")
+       $addressed && &IsChanConfOrWarn("karma")
     ) {
        # to request factoids such as "g++" or "libstdc++", append "?" to the query.
        my ($term,$inc) = (lc $1,$2);
index 8253b8998d0674430b57ddb88e16ec75277df2aa..aa72c528cee2d49010e84be5899734b3c9752626 100644 (file)
@@ -410,7 +410,7 @@ sub userCommands {
     # conversion: ascii.
     if ($message =~ /^(asci*|chr) (\d+)$/) {
        &DEBUG("ascii/chr called ...");
-       return unless (&hasParam("allowConv"));
+       return unless (&IsChanConfOrWarn("allowConv"));
 
        &DEBUG("ascii/chr called");
 
@@ -425,7 +425,7 @@ sub userCommands {
 
     # conversion: ord.
     if ($message =~ /^ord(\s+(.*))$/) {
-       return unless (&hasParam("allowConv"));
+       return unless (&IsChanConfOrWarn("allowConv"));
 
        $arg = $2;
 
@@ -449,7 +449,7 @@ sub userCommands {
 
     # hex.
     if ($message =~ /^hex(\s+(.*))?$/i) {
-       return unless (&hasParam("allowConv"));
+       return unless (&IsChanConfOrWarn("allowConv"));
        my $arg = $2;
 
        if (!defined $arg) {