if ($nick =~ /^$mask{nick}$/) {
&DEBUG("nick: Changing nick to $nick (from $ident)");
rawout("NICK ".$nick);
+ # unfortunately, on_nick doesn't catch ourself.
+ $ident = $nick;
return 1;
}
&DEBUG("nick: failed... why oh why (nick => $nick)");
&status("joinNextChan: $i chans to join.");
}
- # chanserv check: channel specific.
- ### what the hell is this for...
- &chanServCheck($chan);
-
} else {
+ if (exists $cache{joinTime}) {
+ my $delta = time() - $cache{joinTime};
+ my $timestr = &Time2String($delta);
+ my $rate = sprintf("%.1f", $delta / &getJoinChans() );
+ delete $cache{joinTime};
+
+ &DEBUG("time taken to join all chans: $timestr; rate: $rate sec/join");
+ }
# chanserv check: global channels, in case we missed one.
foreach ( &ChanConfList("chanServ_ops") ) {
undef %channels;
undef %floodjoin;
- @joinchan = &getJoinChans();
+ @joinchan = &getJoinChans(1);
+ $cache{joinTime} = time();
}
sub getJoinChans {
+ my($show) = @_;
my @chans;
my @skip;
push(@chans, $_);
}
+ my $str;
if (scalar @skip) {
- &status("gJC: channels not auto-joining: @skip");
+ $str = "gJC: channels not auto-joining: @skip";
} else {
- &status("gJC: auto-joining all chans.");
+ $str = "gJC: auto-joining all chans.";
}
+ &status($str) if ($show);
+
return @chans;
}