From 48daaa91ca5c8da362d81726f410747acaa3bb7d Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 14 May 2023 15:38:51 -0700 Subject: [PATCH] Core/Handlers: Do not auto-reply to NOTICEs --- lib/PBot/Core/Handlers/Chat.pm | 15 +++------------ lib/PBot/Core/Handlers/NickServ.pm | 2 +- lib/PBot/VERSION.pm | 4 ++-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/PBot/Core/Handlers/Chat.pm b/lib/PBot/Core/Handlers/Chat.pm index db08094f..e4372586 100644 --- a/lib/PBot/Core/Handlers/Chat.pm +++ b/lib/PBot/Core/Handlers/Chat.pm @@ -26,23 +26,14 @@ sub on_notice($self, $event_type, $event) { $event->{args}[0], ); - # don't handle non-chat NOTICE + # don't handle server NOTICE return undef if $to eq '*'; # log notice $self->{pbot}->{logger}->log("NOTICE from $nick!$user\@$host to $to: $text\n"); - # if NOTICE is sent to the bot then replace the `to` field with the - # sender's nick instead so when we pass it on to on_public ... - if ($to eq $self->{pbot}->{registry}->get_value('irc', 'botnick')) { - $event->{to}[0] = $nick; - } - - # handle this NOTICE as a public message - # (check for bot commands, anti-flooding, etc) - $self->on_public($event_type, $event); - - return 1; + # nothing further to do with NOTICEs + return undef; } sub on_public($self, $event_type, $event) { diff --git a/lib/PBot/Core/Handlers/NickServ.pm b/lib/PBot/Core/Handlers/NickServ.pm index f5e70292..3e6aca85 100644 --- a/lib/PBot/Core/Handlers/NickServ.pm +++ b/lib/PBot/Core/Handlers/NickServ.pm @@ -67,7 +67,7 @@ sub on_notice($self, $event_type, $event) { # notice from NickServ if (lc $nick eq lc $nickserv) { # log notice - $self->{pbot}->{logger}->log("NOTICE from $nick!$user\@$host to $to: $text\n"); + $self->{pbot}->{logger}->log("Services NOTICE from $nick!$user\@$host to $to: $text\n"); # if we have enabled NickServ GUARD protection and we're not identified yet, # NickServ will warn us to identify -- this is our cue to identify. diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 63c993c1..5f0c3b43 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4674, - BUILD_DATE => "2023-05-11", + BUILD_REVISION => 4675, + BUILD_DATE => "2023-05-14", }; sub initialize {}