From 6dd390540ade5e2625de5aff065bdfa639a84633 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 1 Feb 2023 17:33:09 -0800 Subject: [PATCH] Improve CHGHOST log message --- lib/PBot/Core/Handlers/Server.pm | 6 +++--- lib/PBot/VERSION.pm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PBot/Core/Handlers/Server.pm b/lib/PBot/Core/Handlers/Server.pm index 96ed4d19..4c7c4fda 100644 --- a/lib/PBot/Core/Handlers/Server.pm +++ b/lib/PBot/Core/Handlers/Server.pm @@ -191,8 +191,6 @@ sub on_chghost { my $account = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host); - $self->{pbot}->{logger}->log("[CHGHOST] ($account) $nick!$user\@$host changed host to $nick!$newuser\@$newhost\n"); - my $id = $self->{pbot}->{messagehistory}->{database}->get_message_account_id("$nick!$newuser\@$newhost"); if (defined $id) { @@ -200,9 +198,11 @@ sub on_chghost { $self->{pbot}->{messagehistory}->{database}->link_alias($account, $id, LINK_STRONG); } } else { - $self->{pbot}->{messagehistory}->{database}->add_message_account("$nick!$newuser\@$newhost", $account, LINK_STRONG); + $id = $self->{pbot}->{messagehistory}->{database}->add_message_account("$nick!$newuser\@$newhost", $account, LINK_STRONG); } + $self->{pbot}->{logger}->log("[CHGHOST] ($account) $nick!$user\@$host changed host to ($id) $nick!$newuser\@$newhost\n"); + return 1; } diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 46e9fdef..acfd12a8 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 => 4612, + BUILD_REVISION => 4613, BUILD_DATE => "2023-02-01", };