3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

Clear current NickServ account when logged out

This commit is contained in:
Pragmatic Software 2018-07-31 17:21:15 -07:00
parent b5b513fb77
commit 0a8cef3c2a

View File

@ -907,7 +907,7 @@ sub check_bans {
}
if($self->whitelisted($baninfo->{channel}, $baninfo->{banmask}, 'ban') || $self->whitelisted($baninfo->{channel}, $mask, 'user')) {
$self->{pbot}->{logger}->log("anti-flood: [check-bans] $mask [$alias] evaded $baninfo->{banmask} in $baninfo->{channel}, but allowed through whitelist\n");
#$self->{pbot}->{logger}->log("anti-flood: [check-bans] $mask [$alias] evaded $baninfo->{banmask} in $baninfo->{channel}, but allowed through whitelist\n");
next;
}
@ -1107,6 +1107,9 @@ sub on_accountnotify {
if ($event->{event}->{args}[0] eq '*') {
$self->{pbot}->{logger}->log("$event->{event}->{from} logged out of NickServ\n");
my ($nick, $user, $host) = $event->{event}->{from} =~ m/^([^!]+)!([^@]+)@(.*)/;
my $message_account = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host);
$self->{pbot}->{messagehistory}->{database}->set_current_nickserv_account($message_account, '');
} else {
$self->{pbot}->{logger}->log("$event->{event}->{from} logged into NickServ account $event->{event}->{args}[0]\n");