CVS: blootbot/src/IRC Irc.pl,1.87,1.88
Brought to you by:
timriker
From: Tim R. <tim...@us...> - 2004-03-28 02:34:42
|
Update of /cvsroot/blootbot/blootbot/src/IRC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4292/src/IRC Modified Files: Irc.pl Log Message: joinNextChan tries all connections Index: Irc.pl =================================================================== RCS file: /cvsroot/blootbot/blootbot/src/IRC/Irc.pl,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- Irc.pl 28 Mar 2004 02:01:18 -0000 1.87 +++ Irc.pl 28 Mar 2004 02:23:29 -0000 1.88 @@ -648,19 +648,23 @@ # Usage: &joinNextChan(); sub joinNextChan { - my $mynick = "UNDEF"; - $mynick = $conn->nick() if $conn; - my @join = getJoinChans(1); - - if (scalar @join) { - my $chan = shift @join; - &joinchan($chan); + my $joined = 0; + foreach (sort keys %conns) { + $conn = $conns{$_}; + my $mynick = $conn->nick(); + my @join = getJoinChans(1); + + if (scalar @join) { + my $chan = shift @join; + &joinchan($chan); - if (my $i = scalar @join) { - &status("joinNextChan: $mynick $i chans to join."); + if (my $i = scalar @join) { + &status("joinNextChan: $mynick $i chans to join."); + } + $joined = 1; } - return; } + return if $joined; if (exists $cache{joinTime}) { my $delta = time() - $cache{joinTime} - 5; @@ -670,7 +674,7 @@ my $rate = sprintf("%.1f", $delta / 10); delete $cache{joinTime}; - &status("time taken for $mynick to join all chans: $timestr; rate: $rate sec/join"); + &status("time taken to join all chans: $timestr; rate: $rate sec/join"); } # chanserv check: global channels, in case we missed one. |