From 25a0ec8081a8d2f7fc4bd8bea0119caf0d9cdc38 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 16 Mar 2011 18:38:49 -0600 Subject: [PATCH] Made Auto respond properly to PRIVMSGs received before connection. --- doc/CHANGELOG | 1 + lib/Proto/IRC.pm | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index c0d2a96..5fa757e 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Made Auto respond properly to PRIVMSGs received before connection. * Fixed an exploit in QDB that allowed users to use services fantasy commands with the bot's account. * Heavily improved ./install. diff --git a/lib/Proto/IRC.pm b/lib/Proto/IRC.pm index b338de9..47a32d1 100644 --- a/lib/Proto/IRC.pm +++ b/lib/Proto/IRC.pm @@ -631,10 +631,17 @@ sub part { # Parse: PRIVMSG sub privmsg { my ($svr, @ex) = @_; - my %data = API::IRC::usrc(substr($ex[0], 1)); + my %data; # Ensure this is coming from a user rather than a server. - if ($ex[0] !~ m/!/xsm) { return; } + if ($ex[0] !~ m/!/xsm) { + %data = ( + 'nick' => substr($ex[0], 1), + 'user' => '*', + 'host' => '*' + ); + } + else { %data = API::IRC::usrc(substr($ex[0], 1)) } my @argv; for (my $i = 4; $i < scalar(@ex); $i++) {