Reset lastNick at reconnect so that nick collisions on reconnect are handled correctly. (Also clean up a long line or two since I'm using a small monitor right now...)

This commit is contained in:
ian%hixie.ch 2004-02-08 22:21:04 +00:00
parent 1f093966ec
commit d545d32f9e

View File

@ -291,6 +291,8 @@ my %authenticatedUsers; # hash of user@hostname=>users who have authenticated
# Net::IRC handler subroutines #
################################
my $lastNick;
# setup connection
sub connect {
$uptime = time();
@ -299,6 +301,8 @@ sub connect {
my ($bot, $mailed);
$lastNick = undef;
my $ircname = 'mozbot';
if ($serverRestrictsIRCNames ne $server) {
$ircname = "[$ircname] $helpline";
@ -456,7 +460,7 @@ sub on_whois {
# the bot's host, or whatever
}
my ($lastNick, $nickFirstTried, $nickHadProblem, $nickProblemEscalated) = (undef, 0, 0, 0);
my ($nickFirstTried, $nickHadProblem, $nickProblemEscalated) = (0, 0, 0);
# this is called both for the welcome message (001) and by the on_nick handler
sub on_set_nick {
@ -2063,8 +2067,9 @@ sub JoinedChannel {
my $self = shift;
my ($event, $channel) = @_;
if ($self->{'autojoin'}) {
push(@{$self->{'channels'}}, $channel) unless ((scalar(grep $_ eq $channel, @{$self->{'channels'}})) or
(scalar(grep $_ eq $channel, @{$self->{'channelsBlocked'}})));
push(@{$self->{'channels'}}, $channel)
unless ((scalar(grep $_ eq $channel, @{$self->{'channels'}})) or
(scalar(grep $_ eq $channel, @{$self->{'channelsBlocked'}})));
$self->saveConfig();
}
}