]> git.donarmstrong.com Git - infobot.git/commitdiff
* Fixed verstats to warn the channel about who involked the command
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 May 2008 23:10:41 +0000 (23:10 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 May 2008 23:10:41 +0000 (23:10 +0000)
* Fixed verstats bug that was causing the output to go to random channels (due to loss of variable scope?)
* Added infobot client to verstats and cleaned up a few other client regex
* Added workaround for mIRC VERSION with space bug (see http://rt.cpan.org/Public/Bug/Display.html?id=11421)
* Updated THANKS credits

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1832 c11ca15a-4712-0410-83d8-924469b57eb5

ChangeLog
THANKS
src/CommandStubs.pl
src/IRC/IrcHooks.pl

index 6734c9feb6aaf0fc85de0a2613649220a8b870a3..bca38079c9b33b9af3dd60c606fdcdb67fddcf70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,11 @@ questions in non addressed mode
 
 * Added chanset and help for verstats to allow disabling of command to prevent abuse
 
+* Fixed verstats to warn the channel about who involked the command and bug that
+was causing the output to go to random channels due to loss of variable scope
+
+* Added infobot client to verstats and cleaned up a few other client regex
+
 1.5.2
 =====
 
diff --git a/THANKS b/THANKS
index 20cb9494f33eb9baaa13237da948259b5eb4ea2d..8216bcf6d0d848eb9e88b99eff12f74a174c934b 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -28,5 +28,8 @@ Limbic_Region
 mmap__
 jagerman
 
+#infobot@freenode.net
+---------------------
+quin - many thanks for ctcp version bug help
 
 # vim:ts=4:sw=4:expandtab:tw=80
index ebfefb84fab6ffbffee73f96c634d3404f4c27e0..82886a780f60494fb861f6528fd3c73bb0a61443 100644 (file)
@@ -591,8 +591,14 @@ sub do_verstats {
         return;
     }
 
-    &msg( $who, "Sending CTCP VERSION to $chan; results in 60s." );
-    $conn->ctcp( 'VERSION', $chan );
+    &msg( $who,  "Sending CTCP VERSION to $chan; results in 60s." );
+    &msg( $chan, "WARNING: $who has forced me to CTCP VERSION the channel!" );
+
+    # Workaround for bug in Net::Irc, provided by quin@freenode. Details at:
+    # http://rt.cpan.org/Public/Bug/Display.html?id=11421
+    # $conn->ctcp( 'VERSION', $chan );
+    $conn->sl("PRIVMSG $chan :\001VERSION\001");
+
     $cache{verstats}{chan}    = $chan;
     $cache{verstats}{who}     = $who;
     $cache{verstats}{msgType} = $msgType;
@@ -618,7 +624,6 @@ sub do_verstats {
             my $vtotal = 0;
             my $c      = lc $cache{verstats}{chan};
             my $total  = keys %{ $channels{$c}{''} };
-            $chan    = $c;
             $who     = $cache{verstats}{who};
             $msgType = $cache{verstats}{msgType};
             delete $cache{verstats};    # sufficient?
@@ -651,8 +656,7 @@ sub do_verstats {
             }
 
             # hack. this is one major downside to scheduling.
-            $chan = $c;
-            &performStrictReply(
+            &msg($c,
                 &formListReply( 0, "IRC Client versions for $c ", @list ) );
 
             # clean up not-needed data structures.
@@ -669,7 +673,9 @@ sub verstats_flush {
         last unless ( scalar @vernicktodo );
 
         my $n = shift(@vernicktodo);
-        $conn->ctcp( 'VERSION', $n );
+        #$conn->ctcp( 'VERSION', $n );
+        # See do_verstats $conn->sl for explantaion
+        $conn->sl("PRIVMSG $n :\001VERSION\001");
     }
 
     return unless ( scalar @vernicktodo );
index af96470589624f5854bdf4d98501566ae5a73045..b143653df407e369d39fc4da8a43b4c66cf3db99 100644 (file)
@@ -1201,11 +1201,17 @@ sub on_crversion {
     }
     push( @vernick, $nick );
 
+    &DEBUG("on_crversion: Got '$ver' from $nick");
+
     if ( $ver =~ /bitchx/i ) {
         $ver{bitchx}{$nick} = $ver;
 
     }
-    elsif ( $ver =~ /xc\!|xchat/i ) {
+    elsif ( $ver =~ /infobot/i ) {
+        $ver{infobot}{$nick} = $ver;
+
+    }
+    elsif ( $ver =~ /(xc\!|xchat)/i ) {
         $ver{xchat}{$nick} = $ver;
 
     }
@@ -1213,20 +1219,19 @@ sub on_crversion {
         $ver{irssi}{$nick} = $ver;
 
     }
-    elsif ( $ver =~ /epic|(Third Eye)/i ) {
+    elsif ( $ver =~ /(epic|Third Eye)/i ) {
         $ver{epic}{$nick} = $ver;
 
     }
-    elsif ( $ver =~ /ircII|PhoEniX/i ) {
+    elsif ( $ver =~ /(ircII|PhoEniX)/i ) {
         $ver{ircII}{$nick} = $ver;
 
     }
     elsif ( $ver =~ /mirc/i ) {
-
-        #      &DEBUG("verstats: mirc: $nick => '$ver'.");
+        # Apparently, mIRC gets the reply as "VERSION " and doesnt like the
+        # space, so mirc matching is considered bugged.
         $ver{mirc}{$nick} = $ver;
 
-        # ok... then we get to the lesser known/used clients.
     }
     elsif ( $ver =~ /ircle/i ) {
         $ver{ircle}{$nick} = $ver;