From 88bafa062506d1cbc03c8fb2f4d44759c85fe7a0 Mon Sep 17 00:00:00 2001 From: djmcgrath Date: Sat, 17 May 2008 23:10:41 +0000 Subject: [PATCH] * Fixed verstats to warn the channel about who involked the command * 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 | 5 +++++ THANKS | 3 +++ src/CommandStubs.pl | 18 ++++++++++++------ src/IRC/IrcHooks.pl | 17 +++++++++++------ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6734c9f..bca3807 100644 --- 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 20cb949..8216bcf 100644 --- 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 diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index ebfefb8..82886a7 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -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 ); diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index af96470..b143653 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -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; -- 2.39.2