diff --git a/lib/PBot/Core/AntiFlood.pm b/lib/PBot/Core/AntiFlood.pm index 648ab93c..8f0e3430 100644 --- a/lib/PBot/Core/AntiFlood.pm +++ b/lib/PBot/Core/AntiFlood.pm @@ -224,7 +224,7 @@ sub check_flood { my $channels; if ($mode == MSG_NICKCHANGE) { - $channels = $self->{pbot}->{nicklist}->get_channels($oldnick); + $channels = $self->{pbot}->{nicklist}->get_channels($nick); } else { $self->update_join_watch($account, $channel, $text, $mode); push @$channels, $channel; diff --git a/lib/PBot/Core/Handlers/NickList.pm b/lib/PBot/Core/Handlers/NickList.pm index d020f0b4..edd68691 100644 --- a/lib/PBot/Core/Handlers/NickList.pm +++ b/lib/PBot/Core/Handlers/NickList.pm @@ -24,13 +24,13 @@ sub initialize { $self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_activity(@_) }, 0); $self->{pbot}->{event_dispatcher}->register_handler('irc.caction', sub { $self->on_activity(@_) }, 0); $self->{pbot}->{event_dispatcher}->register_handler('irc.modeflag', sub { $self->on_modeflag(@_) }, 0); + $self->{pbot}->{event_dispatcher}->register_handler('irc.nick', sub { $self->on_nickchange(@_) }, 0); # lowest priority so these get handled by NickList after all other handlers # (all other handlers should be given a priority < 100) $self->{pbot}->{event_dispatcher}->register_handler('irc.part', sub { $self->on_part(@_) }, 100); $self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_quit(@_) }, 100); $self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) }, 100); - $self->{pbot}->{event_dispatcher}->register_handler('irc.nick', sub { $self->on_nickchange(@_) }, 100); # handlers for the bot itself joining/leaving channels (highest priority) $self->{pbot}->{event_dispatcher}->register_handler('pbot.join', sub { $self->on_self_join(@_) }, 0); diff --git a/lib/PBot/Core/Handlers/SASL.pm b/lib/PBot/Core/Handlers/SASL.pm index 5150a6aa..14a8b8f0 100644 --- a/lib/PBot/Core/Handlers/SASL.pm +++ b/lib/PBot/Core/Handlers/SASL.pm @@ -32,7 +32,8 @@ sub initialize { sub on_sasl_authenticate { my ($self, $event_type, $event) = @_; - my $nick = $self->{pbot}->{registry}->get_value('irc', 'botnick'); + my $nick = $self->{pbot}->{registry}->get_value('irc', 'identify_nick'); # try identify_nick + $nick //= $self->{pbot}->{registry}->get_value('irc', 'botnick'); # fallback to botnick my $password = $self->{pbot}->{registry}->get_value('irc', 'identify_password'); if (not defined $password or not length $password) { diff --git a/lib/PBot/Core/Handlers/Server.pm b/lib/PBot/Core/Handlers/Server.pm index 79397697..89a458f0 100644 --- a/lib/PBot/Core/Handlers/Server.pm +++ b/lib/PBot/Core/Handlers/Server.pm @@ -146,7 +146,7 @@ sub on_nickchange { my $message_account = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host); $self->{pbot}->{messagehistory}->{database}->devalidate_all_channels($message_account, $self->{pbot}->{antiflood}->{NEEDS_CHECKBAN}); - my $channels = $self->{pbot}->{nicklist}->get_channels($nick); + my $channels = $self->{pbot}->{nicklist}->get_channels($newnick); foreach my $channel (@$channels) { next if $channel !~ m/^#/; $self->{pbot}->{messagehistory}->add_message($message_account, "$nick!$user\@$host", $channel, "NICKCHANGE $newnick", MSG_NICKCHANGE); diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 30e59966..2130aa84 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4619, + BUILD_REVISION => 4620, BUILD_DATE => "2023-02-13", };