From 7bbd5d809737bae3c4304a2099cf1ef5967e600e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 1 Feb 2023 17:47:25 -0800 Subject: [PATCH] Fix QUIT log message --- lib/PBot/Core/AntiFlood.pm | 5 +++-- lib/PBot/Core/Handlers/Channel.pm | 1 + lib/PBot/VERSION.pm | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/PBot/Core/AntiFlood.pm b/lib/PBot/Core/AntiFlood.pm index 9b87c77f..73513ca3 100644 --- a/lib/PBot/Core/AntiFlood.pm +++ b/lib/PBot/Core/AntiFlood.pm @@ -112,6 +112,7 @@ sub check_flood { my $oldnick = $nick; my $account; + # handle old-style pseudo-QUIT for changing-host if CHGHOST is not available if ($mode == MSG_JOIN and exists $self->{changinghost}->{$nick}) { $self->{pbot}->{logger}->log("Finalizing host change for $nick.\n"); @@ -152,9 +153,9 @@ sub check_flood { if ($mode == MSG_CHAT) { $self->{pbot}->{logger}->log("[MSG] $channel ($account) $mask => $text\n"); } else { - my $from = $channel eq lc $mask ? "QUIT" : $channel; + my $from = $channel eq lc $mask ? undef : $channel; my ($type) = $text =~ /^(\w+) /; - $self->{pbot}->{logger}->log("[$type] $from ($account) $mask => $text\n"); + $self->{pbot}->{logger}->log("[$type] " . (defined $from ? "$from " : '') . "($account) $mask => $text\n"); } } diff --git a/lib/PBot/Core/Handlers/Channel.pm b/lib/PBot/Core/Handlers/Channel.pm index 4bb497b6..7afbfb2a 100644 --- a/lib/PBot/Core/Handlers/Channel.pm +++ b/lib/PBot/Core/Handlers/Channel.pm @@ -23,6 +23,7 @@ sub initialize { $self->{pbot}->{event_dispatcher}->register_handler('irc.mode', sub { $self->on_mode (@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.join', sub { $self->on_join (@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.part', sub { $self->on_departure (@_) }); + $self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_departure (@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick (@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.invite', sub { $self->on_invite (@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.channelmodeis', sub { $self->on_channelmodeis (@_) }); diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index acfd12a8..8bf732c6 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4613, + BUILD_REVISION => 4614, BUILD_DATE => "2023-02-01", };