mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Do not process server NOTICES as public messages
Add time-out to automatically unban ##fix_your_connection ban-forwards
This commit is contained in:
parent
511994025c
commit
16f467252b
@ -51,8 +51,7 @@ sub default_handler {
|
||||
|
||||
if(not defined $self->{pbot}->{event_dispatcher}->dispatch_event("irc.$event->{type}", { conn => $conn, event => $event })) {
|
||||
if ($self->{pbot}->{registry}->get_value('irc', 'log_default_handler')) {
|
||||
my $dump = Dumper $event;
|
||||
$self->{pbot}->{logger}->log($dump);
|
||||
$self->{pbot}->{logger}->log(Dumper $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -128,6 +127,8 @@ sub on_notice {
|
||||
|
||||
$self->{pbot}->{logger}->log("Received NOTICE from $nick!$user\@$host to $event->{event}->{to}[0] '$text'\n");
|
||||
|
||||
return 0 if not length $host;
|
||||
|
||||
if($nick eq 'NickServ') {
|
||||
if($text =~ m/This nickname is registered/) {
|
||||
$self->{pbot}->{logger}->log("Identifying with NickServ . . .\n");
|
||||
@ -201,7 +202,7 @@ sub on_mode {
|
||||
}
|
||||
else { # bot not targeted
|
||||
if($mode eq "+b") {
|
||||
if($nick eq "ChanServ") {
|
||||
if($nick eq "ChanServ" or $target =~ m/##fix_your_connection$/i) {
|
||||
if ($self->{pbot}->{chanops}->can_gain_ops($channel)) {
|
||||
$self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('bantracker', 'chanserv_ban_timeout');
|
||||
$self->{pbot}->{chanops}->{unban_timeout}->save;
|
||||
|
Loading…
Reference in New Issue
Block a user