mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-04 08:24:06 +01:00
Factoids: add blank line between factlog
entries
This commit is contained in:
parent
49d92aa1bd
commit
68490b6ac5
@ -888,10 +888,12 @@ sub cmd_factlog {
|
|||||||
# factoid not found or some error, try to continue and load factlog file if it exists
|
# factoid not found or some error, try to continue and load factlog file if it exists
|
||||||
my $arglist = $self->{pbot}->{interpreter}->make_args($args);
|
my $arglist = $self->{pbot}->{interpreter}->make_args($args);
|
||||||
($channel, $trigger) = $self->{pbot}->{interpreter}->split_args($arglist, 2);
|
($channel, $trigger) = $self->{pbot}->{interpreter}->split_args($arglist, 2);
|
||||||
|
|
||||||
if (not defined $trigger) {
|
if (not defined $trigger) {
|
||||||
$trigger = $channel;
|
$trigger = $channel;
|
||||||
$channel = $context->{from};
|
$channel = $context->{from};
|
||||||
}
|
}
|
||||||
|
|
||||||
$channel = '.*' if $channel !~ m/^#/;
|
$channel = '.*' if $channel !~ m/^#/;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -909,6 +911,7 @@ sub cmd_factlog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
my @entries;
|
my @entries;
|
||||||
|
|
||||||
while (my $line = <$fh>) {
|
while (my $line = <$fh>) {
|
||||||
my ($timestamp, $hostmask, $msg);
|
my ($timestamp, $hostmask, $msg);
|
||||||
|
|
||||||
@ -918,14 +921,21 @@ sub cmd_factlog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
($timestamp, $hostmask, $msg) = split /\s+/, $line, 3 if $@;
|
($timestamp, $hostmask, $msg) = split /\s+/, $line, 3 if $@;
|
||||||
|
|
||||||
$hostmask =~ s/!.*$// if not $show_hostmask;
|
$hostmask =~ s/!.*$// if not $show_hostmask;
|
||||||
|
|
||||||
if ($actual_timestamp) { $timestamp = strftime "%a %b %e %H:%M:%S %Z %Y", localtime $timestamp; }
|
if ($actual_timestamp) {
|
||||||
else { $timestamp = concise ago gettimeofday - $timestamp; }
|
$timestamp = strftime "%a %b %e %H:%M:%S %Z %Y", localtime $timestamp;
|
||||||
|
} else {
|
||||||
|
$timestamp = concise ago gettimeofday - $timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
push @entries, "[$timestamp] $hostmask $msg\n";
|
push @entries, "[$timestamp] $hostmask $msg\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
close $fh;
|
close $fh;
|
||||||
my $result = join "", reverse @entries;
|
|
||||||
|
my $result = join "\n", reverse @entries;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4358,
|
BUILD_REVISION => 4359,
|
||||||
BUILD_DATE => "2021-08-19",
|
BUILD_DATE => "2021-08-22",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
Reference in New Issue
Block a user