mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-02 18:19:33 +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
|
||||
my $arglist = $self->{pbot}->{interpreter}->make_args($args);
|
||||
($channel, $trigger) = $self->{pbot}->{interpreter}->split_args($arglist, 2);
|
||||
|
||||
if (not defined $trigger) {
|
||||
$trigger = $channel;
|
||||
$channel = $context->{from};
|
||||
}
|
||||
|
||||
$channel = '.*' if $channel !~ m/^#/;
|
||||
}
|
||||
|
||||
@ -909,6 +911,7 @@ sub cmd_factlog {
|
||||
};
|
||||
|
||||
my @entries;
|
||||
|
||||
while (my $line = <$fh>) {
|
||||
my ($timestamp, $hostmask, $msg);
|
||||
|
||||
@ -918,14 +921,21 @@ sub cmd_factlog {
|
||||
};
|
||||
|
||||
($timestamp, $hostmask, $msg) = split /\s+/, $line, 3 if $@;
|
||||
|
||||
$hostmask =~ s/!.*$// if not $show_hostmask;
|
||||
|
||||
if ($actual_timestamp) { $timestamp = strftime "%a %b %e %H:%M:%S %Z %Y", localtime $timestamp; }
|
||||
else { $timestamp = concise ago gettimeofday - $timestamp; }
|
||||
if ($actual_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";
|
||||
}
|
||||
|
||||
close $fh;
|
||||
my $result = join "", reverse @entries;
|
||||
|
||||
my $result = join "\n", reverse @entries;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4358,
|
||||
BUILD_DATE => "2021-08-19",
|
||||
BUILD_REVISION => 4359,
|
||||
BUILD_DATE => "2021-08-22",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user