]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
disable wantnick
[infobot.git] / src / UserExtra.pl
index 30b05f5c9187c345abcd23151c54f4416709608e..8a29c7d17a86e17674778a167a8d17a3b01d15da 100644 (file)
@@ -60,7 +60,7 @@ sub chaninfo {
        foreach (sort keys %channels) {
            if ( /^\s*$/ or / / ) {
                &status("chanstats: fe channels: chan == NULL.");
-               &ircCheck();
+               #&ircCheck();
                next;
            }
            next if (/^_default$/);
@@ -69,6 +69,7 @@ sub chaninfo {
            push(@array, $str);
        }
        &pSReply($reply.": ".join(', ', @array));
+       &ircCheck();
 
        ### total user count.
        foreach $chan (keys %channels) {
@@ -164,7 +165,7 @@ sub chaninfo {
        $new{$_} = $userstats{$_}{'Count'};
     }
 
-    # todo: show top 3 with percentages?
+    # TODO: show top 3 with percentages?
     my($count) = (sort { $new{$a} <=> $new{$b} } keys %new)[0];
     if ($count) {
        $reply .= ".  \002$count\002 has said the most with a total of \002$new{$count}\002 messages";
@@ -486,7 +487,7 @@ sub do_countrystats {
        push(@list, "$str ($_, $perc %)");
     }
 
-    # todo: move this into a scheduler like nickometer
+    # TODO: move this into a scheduler like nickometer
     $msgType   = "private";
     &pSReply( &formListReply(0, "Country Stats ", @list) );
 
@@ -535,7 +536,7 @@ sub userCommands {
            }
        }
 
-       &performReply( sprintf("'%s' is ascii %s", $arg, ord $1) );
+       &performReply( sprintf("'%s' is ascii %s", $arg, ord $arg) );
        return;
     }
 
@@ -795,7 +796,7 @@ sub userCommands {
     if ($message =~ /^statu?s$/i) {
        my $startString = scalar(gmtime $^T);
        my $upString    = &Time2String(time() - $^T);
-       my ($auser,$asystem,$cuser,$csystem) = times;
+       my ($puser,$psystem,$cuser,$csystem) = times;
        my $factoids    = &countKeys("factoids");
        my $forks = 0;
        foreach (keys %forked) {
@@ -824,7 +825,7 @@ sub userCommands {
          "I'm using about \002$memusage\002 ".
          "kB of memory. With \002$forks\002 active ".
                &fixPlural("fork",$forks).
-         ". uptimes $auser,$asystem,$cuser,$csystem"
+         ". Process time user/system $puser/$psystem child $cuser/$csystem"
        );
 
        return;
@@ -848,45 +849,45 @@ if (0) {
     }
 
     # wantNick. xk++
-    if ($message =~ /^wantNick(\+)?$/i) {
-       my ($force) = ($1) ? 1 : 0;
-       $force = 0 unless (&IsFlag("n"));
-
-       # cannot trust Net::IRC's nick()
-       if ($param{'ircNick'} eq $ident) {
-           &msg($who, "I hope you're right. I'll try anyway.");
-           &DEBUG("ircNick => $param{'ircNick'}");
-           &DEBUG("ident => $ident");
-       }
-
-       # fallback check, I guess.  needed?
-       if (! &IsNickInAnyChan( $param{'ircNick'} ) ) {
-           my $str = "attempting to change nick to $param{'ircNick'}";
-           &status($str);
-           &msg($who, $str);
-           &nick($param{ 'ircNick' });
-           return;
-       }
-
-       # idea from dondelecarlo :)
-       # todo: use cache{nickserv}
-       if ($param{'nickServ_pass'}) {
-           return if ($param{'ircNick'} eq $ident or $force == 0);
-
-           &status("someone is using our nick; GHOSTing");
-           &msg($who, "using GHOST on $param{'ircNick'}.");
-           &msg("NickServ", "GHOST $param{'ircNick'} $param{'nickServ_pass'}");
-
-           $conn->schedule(5, sub {
-               &status("going to change nick after GHOST.");
-               &nick( $param{'ircNick'} );
-           } );
-
-           return;
-       }
-
-       return;
-    }
+#    if ($message =~ /^wantNick(\+)?$/i) {
+#      my ($force) = ($1) ? 1 : 0;
+#      $force = 0 unless (&IsFlag("n"));
+#
+#      # cannot trust Net::IRC's nick() (TimRiker asks why?)
+#      if ($param{'ircNick'} eq $ident) {
+#          &msg($who, "I hope you're right. I'll try anyway.");
+#          &DEBUG("ircNick => $param{'ircNick'}");
+#          &DEBUG("ident => $ident");
+#      }
+#
+#      # fallback check, I guess.  needed?
+#      if (! &IsNickInAnyChan( $param{'ircNick'} ) ) {
+#          my $str = "attempting to change nick to $param{'ircNick'}";
+#          &status($str);
+#          &msg($who, $str);
+#          &nick($param{ 'ircNick' });
+#          return;
+#      }
+#
+#      # idea from dondelecarlo :)
+#      # TODO: use cache{nickserv}
+#      if ($param{'nickServ_pass'}) {
+#          return if ($param{'ircNick'} eq $ident or $force == 0);
+#
+#          &status("someone is using our nick; GHOSTing");
+#          &msg($who, "using GHOST on $param{'ircNick'}.");
+#          &msg("NickServ", "GHOST $param{'ircNick'} $param{'nickServ_pass'}");
+#
+#          $conn->schedule(5, sub {
+#              &status("going to change nick after GHOST.");
+#              &nick( $param{'ircNick'} );
+#          } );
+#
+#          return;
+#      }
+#
+#      return;
+#   }
 
     return "CONTINUE";
 }