]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Process.pl
- added support/hack for channel +o as "+o" in bot user file.
[infobot.git] / src / Process.pl
index dd3d80ca81ca144ee8f184309d59e191ddc10d74..cbdb6cabbf4dca06e6087781745b1b1ce490efa4 100644 (file)
@@ -6,7 +6,7 @@
 # process the incoming message
 #
 
-if (&IsParam("useStrict")) { use strict; }
+#use strict;
 
 sub process {
     $learnok   = 0;    # Able to learn?
@@ -22,6 +22,15 @@ sub process {
 
     &shmFlush();               # hack.
 
+    # hack to support channel +o as "+o" in bot user file.
+    # requires +O in user file.
+    # is $who arg lowercase?
+    if (exists $channels{$chan}{o}{ $orig{who} } && &IsFlag("O") eq "O") {
+       &status("Gave $who/$chan +o (+O)\'ness");
+       $users{$userHandle}{FLAGS} =~ s/o//g;
+       $users{$userHandle}{FLAGS} .= "o";
+    }
+
     # check if we have our head intact.
     if ($lobotomized) {
        if ($addressed and IsFlag("o") eq "o") {
@@ -240,7 +249,7 @@ sub process {
 
        # customized random message.
        my $tmp = (rand() < 0.5) ? ", $who" : "";
-       &performStrictReply(&getRandom(keys %{ $lang{'hello'} }) . $tmp);
+       &pSReply( &getRandom(keys %{ $lang{'hello'} }) . $tmp );
        return;
     }
 
@@ -262,7 +271,7 @@ sub process {
        &status("random praise detected");
 
        my $tmp = (rand() < 0.5) ? "thanks $who " : "";
-       &performStrictReply($tmp.":)");
+       &pSReply($tmp.":)");
 
        return;
     }
@@ -329,7 +338,7 @@ sub process {
        }
     }
 
-    if (&IsParam("factoids") and $param{'DBType'} =~ /^(mysql|pg|postgres|dbm)/i) {
+    if (&IsParam("factoids") and $param{'DBType'} =~ /^(mysql|pgsql|dbm)/i) {
        &FactoidStuff();
     } elsif ($param{'DBType'} =~ /^none$/i) {
        return "NO FACTOIDS.";