diff --git a/logger.pm b/logger.pm index 1c39ddf..bc8f8f0 100644 --- a/logger.pm +++ b/logger.pm @@ -333,8 +333,8 @@ sub handleNick { if(!$found || !prepareLogFile($aLogFiles, $aServerName, $channel)) { next; } - $aLogFiles->{$aCommand->[1]}{"file"}->print(sprintf("(%s) %s is now known as %s\n", localtime->strftime("%H:%M:%S"), $username, $aCommand->[1])); - $aLogFiles->{$aCommand->[1]}{"file"}->flush(); + $aLogFiles->{$channel}{"file"}->print(sprintf("(%s) %s is now known as %s\n", localtime->strftime("%H:%M:%S"), $username, $aCommand->[1])); + $aLogFiles->{$channel}{"file"}->flush(); } } @@ -484,10 +484,10 @@ while(my @row = $query->fetchrow_array()) { my $host = $row[2]; my $port = $row[3]; - $query = $db->prepare(qq(select name from channels where server_id=$id;)); - $query->execute(); + my $channelQuery = $db->prepare(qq(select name from channels where server_id=$id;)); + $channelQuery->execute(); my @channels; - while(my @channelsRow = $query->fetchrow_array()) { + while(my @channelsRow = $channelQuery->fetchrow_array()) { my $name = $channelsRow[0]; push(@channels, $name); }