Make XMLLogger work again (fallout from the time patch a while back)

This commit is contained in:
ian%hixie.ch 2004-01-27 01:29:18 +00:00
parent cb26702f03
commit 14075125c3

View File

@ -94,7 +94,8 @@ sub DoLog {
# wohay, we have a candidate! # wohay, we have a candidate!
# now check for possible blockers... # now check for possible blockers...
unless ($self->isBlocked($event)) { unless ($self->isBlocked($event)) {
$self->WriteMessage($event->{'channel'}, $self->WriteMessage($event->{'time'},
$event->{'channel'},
$event->{'from'}, $event->{'from'},
$event->{'fulldata'}, $event->{'fulldata'},
$messageType); $messageType);
@ -119,12 +120,12 @@ sub isBlocked {
sub WriteMessage { sub WriteMessage {
my $self = shift; my $self = shift;
my ($channel, $from, $message, $messageType) = @_; my ($time, $channel, $from, $message, $messageType) = @_;
# Open the log file and append the message # Open the log file and append the message
$channel = $self->sanitiseChannelName($channel); $channel = $self->sanitiseChannelName($channel);
my $logName = $self->getLogFilename("$channel.xml.part"); my $logName = $self->getLogFilename("$channel.xml.part");
if (open(LOG, ">>$logName")) { if (open(LOG, ">>$logName")) {
my $msgtime = $self->logdate($event->{'time'}); my $msgtime = $self->logdate($time);
# sanitise the output # sanitise the output
$_ = $self->escapeXML($_) for ($messageType, $channel, $from, $msgtime, $message); $_ = $self->escapeXML($_) for ($messageType, $channel, $from, $msgtime, $message);
print LOG "<$messageType channel=\"$channel\" nick=\"$from\" time=\"$msgtime\">$message</$messageType>\n"; print LOG "<$messageType channel=\"$channel\" nick=\"$from\" time=\"$msgtime\">$message</$messageType>\n";