From c306ae4ce627b73219ca8f27160b8558340fa01a Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 22 Dec 2015 08:12:59 -0800 Subject: [PATCH] Minor text reformatting --- PBot/FactoidCommands.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index ac715867..803eb918 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -177,7 +177,7 @@ sub factset { my $result = $self->{pbot}->{factoids}->{factoids}->set($channel, $trigger, $key, $value); - if ($result =~ m/set to/) { + if (defined $value and $result =~ m/set to/) { if (defined $oldvalue and $oldvalue ne $value) { $self->log_factoid($channel, $trigger, "$nick!$user\@$host", "set $key from $oldvalue to $value"); } else { @@ -896,15 +896,15 @@ sub top20 { $text = "Top $i referenced factoids for $channel: $text" if $i > 0; return $text; } - } else { - if(lc $args eq "recent") { foreach my $chan (sort keys %{ $factoids }) { next if lc $chan ne lc $channel; foreach my $command (sort { $factoids->{$chan}->{$b}{created_on} <=> $factoids->{$chan}->{$a}{created_on} } keys %{ $factoids->{$chan} }) { - my $ago = ago(gettimeofday - $factoids->{$chan}->{$command}->{created_on}); - $text .= " $command [$ago by $factoids->{$chan}->{$command}->{owner}]\n"; + my $ago = concise ago gettimeofday - $factoids->{$chan}->{$command}->{created_on}; + my $owner = $factoids->{$chan}->{$command}->{owner}; + $owner =~ s/!.*$//; + $text .= " $command [$ago by $owner]\n"; $i++; last if $i >= 50; } @@ -1123,7 +1123,7 @@ sub factchange { $factoids->{$channel}->{$trigger}->{edited_by} = "$nick!$user\@$host"; $factoids->{$channel}->{$trigger}->{edited_on} = gettimeofday; $self->{pbot}->{factoids}->save_factoids(); - $self->log_factoid($channel, $trigger, "$nick!$user\@$host", "changed action to $factoids->{$channel}->{$trigger}->{action}"); + $self->log_factoid($channel, $trigger, "$nick!$user\@$host", "changed to $factoids->{$channel}->{$trigger}->{action}"); return "Changed: $trigger is " . $factoids->{$channel}->{$trigger}->{action}; } };