3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-17 09:29:30 +01:00

AntiFlood: add some missing nickserv account case normalization

This commit is contained in:
Pragmatic Software 2024-09-28 12:19:37 -07:00
parent 50ca5b57f6
commit a453518fab
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 6 additions and 6 deletions

View File

@ -199,8 +199,8 @@ sub check_flood($self, $channel, $nick, $user, $host, $text, $max_messages, $max
my $tags = $self->{pbot}->{irc}->get_tags($context->{tags}); my $tags = $self->{pbot}->{irc}->get_tags($context->{tags});
if (defined $tags->{account}) { if (defined $tags->{account}) {
my $nickserv_account = $tags->{account}; my $nickserv_account = lc $tags->{account};
my $current_nickserv_account = $self->{pbot}->{messagehistory}->{database}->get_current_nickserv_account($account); my $current_nickserv_account = lc $self->{pbot}->{messagehistory}->{database}->get_current_nickserv_account($account);
if ($self->{pbot}->{registry}->get_value('irc', 'debug_tags')) { if ($self->{pbot}->{registry}->get_value('irc', 'debug_tags')) {
$self->{pbot}->{logger}->log("($account) $mask got account-tag $nickserv_account\n"); $self->{pbot}->{logger}->log("($account) $mask got account-tag $nickserv_account\n");
@ -621,7 +621,7 @@ sub check_bans($self, $message_account, $mask, $channel, $dry_run = 0) {
my $debug_checkban = $self->{pbot}->{registry}->get_value('antiflood', 'debug_checkban'); my $debug_checkban = $self->{pbot}->{registry}->get_value('antiflood', 'debug_checkban');
my $current_nickserv_account = $self->{pbot}->{messagehistory}->{database}->get_current_nickserv_account($message_account); my $current_nickserv_account = lc $self->{pbot}->{messagehistory}->{database}->get_current_nickserv_account($message_account);
$self->{pbot}->{logger}->log("anti-flood: [check-bans] checking for bans on ($message_account) $mask " $self->{pbot}->{logger}->log("anti-flood: [check-bans] checking for bans on ($message_account) $mask "
. (defined $current_nickserv_account and length $current_nickserv_account ? "[$current_nickserv_account] " : "") . (defined $current_nickserv_account and length $current_nickserv_account ? "[$current_nickserv_account] " : "")
@ -892,7 +892,7 @@ sub on_whoisaccount($self, $event_type, $event) {
sub on_accountnotify($self, $event_type, $event) { sub on_accountnotify($self, $event_type, $event) {
my $mask = $event->{from}; my $mask = $event->{from};
my ($nick, $user, $host) = $mask =~ m/^([^!]+)!([^@]+)@(.*)/; my ($nick, $user, $host) = $mask =~ m/^([^!]+)!([^@]+)@(.*)/;
my $account = $event->{args}[0]; my $account = lc $event->{args}[0];
my $id = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host); my $id = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host);
$self->{pbot}->{messagehistory}->{database}->update_hostmask_data($mask, {last_seen => scalar gettimeofday}); $self->{pbot}->{messagehistory}->{database}->update_hostmask_data($mask, {last_seen => scalar gettimeofday});

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4790, BUILD_REVISION => 4791,
BUILD_DATE => "2024-09-23", BUILD_DATE => "2024-09-28",
}; };
sub initialize {} sub initialize {}