3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

IRCHandlers: handle RPL_NONONREG

This commit is contained in:
Pragmatic Software 2021-06-24 18:40:05 -07:00
parent f1c5b8c706
commit 4e3e547ba7
2 changed files with 12 additions and 1 deletions

View File

@ -422,7 +422,7 @@ sub trans {
483 => "cantkillserver",
484 => "ischanservice", # Undernet Extension, Kajetan@Hinner.com, 17/10/98
485 => "killdeny", # UnrealIrcd, Hendrik Frenzel
486 => "htmdisabled", # UnrealIrcd, Hendrik Frenzel
486 => "nononreg", # UnrealIrcd, Hendrik Frenzel # renamed to nononreg - pragma June 24, 2021
489 => "secureonlychan", # UnrealIrcd, Hendrik Frenzel
491 => "nooperhost",
492 => "noservicehost",

View File

@ -58,6 +58,7 @@ sub initialize {
$ed->register_handler('irc.notregistered', sub { $self->log_first_arg (@_) });
$ed->register_handler('irc.n_local', sub { $self->log_third_arg (@_) });
$ed->register_handler('irc.n_global', sub { $self->log_third_arg (@_) });
$ed->register_handler('irc.nononreg', sub { $self->on_nononreg (@_) });
# IRCv3 client capabilities
$ed->register_handler('irc.cap', sub { $self->on_cap(@_) });
@ -882,6 +883,16 @@ sub on_topicinfo {
return 0;
}
sub on_nononreg {
my ($self, $event_type, $event) = @_;
my $target = $event->{event}->{args}->[1];
$self->{pbot}->{logger}->log("Cannot send private /msg to $target; they are blocking unidentified /msgs.\n");
return 0;
}
sub log_first_arg {
my ($self, $event_type, $event) = @_;
$self->{pbot}->{logger}->log("$event->{event}->{args}->[1]\n");