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++) {