]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
join debugging
[infobot.git] / src / UserExtra.pl
index 47551b5f88f32cee8217c87d3aa19c7278fe00e3..fe28e79292f716016b641d6cf54e6ea0efd9100e 100644 (file)
@@ -21,7 +21,6 @@ sub chaninfo {
 
     if ( $chan eq '' ) {    # all channels.
         my $i = keys %channels;
-        my $reply = "I'm on \002$i\002 " . &fixPlural( 'channel', $i );
         my $tucount = 0;    # total user count.
         my $uucount = 0;    # unique user count.
         my %chans;
@@ -42,7 +41,6 @@ sub chaninfo {
         foreach $chan ( sort { $chans{$b} <=> $chans{$a} } keys %chans ) {
             push( @array, "$chan/" . $chans{$chan} );
         }
-        &performStrictReply( $reply . ': ' . join( ', ', @array ) );
 
         ### total user count.
         foreach $chan ( keys %channels ) {
@@ -60,14 +58,12 @@ sub chaninfo {
         $uucount = scalar( keys %nicks );
 
         my $chans = scalar( keys %channels );
-        &performStrictReply( "i've cached \002$tucount\002 "
-              . &fixPlural( 'user', $tucount )
-              . ", \002$uucount\002 unique "
-              . &fixPlural( 'user', $uucount )
-              . ", distributed over \002$chans\002 "
-              . &fixPlural( 'channel', $chans )
-              . '.' );
-        &ircCheck();
+        my $join = &ircCheck();
+        &performStrictReply(
+              "\002$chans/".($chans+$join)."\002 " . &fixPlural('channel', $chans)
+              . ", \002$tucount\002 " . &fixPlural('user', $tucount)
+              . ", \002$uucount\002 unique: "
+              . join(', ', @array));
 
         return;
     }
@@ -170,7 +166,21 @@ sub cmdstats {
             push( @array, "\002$int\002 of $_" );
         }
     }
-    &performStrictReply( 'command usage include ' . &IJoin(@array) . '.' );
+    &performStrictReply( 'command usage includes ' . &IJoin(@array) . '.' );
+}
+
+# Command statistics.
+sub conninfo {
+    my $reply = 'conninfo:';
+    my $key;
+    foreach $key ( sort keys %::conns ) {
+        my $myconn = $::conns{$key};
+       $reply .= " $key/";
+       next if (!defined $myconn);
+        my $mynick = $myconn->nick();
+       $reply .= "$mynick";
+    }
+    &performStrictReply( "conninfo: $reply.");
 }
 
 # Factoid extension info. xk++
@@ -517,6 +527,8 @@ sub userCommands {
 
         &status("USER reload $who");
         &performStrictReply('reloading...');
+        &readUserFile();
+        &readChanFile();
         my $modules = &reloadAllModules();
         &performStrictReply("reloaded:$modules");
         return;