From 80bceb2c75caa43fb093619e46b6ab3a9a8d6ce1 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 27 Aug 2017 19:02:48 -0700 Subject: [PATCH] Make fact log of factset more concise --- PBot/FactoidCommands.pm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index 33208efb..ad05131a 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -341,8 +341,6 @@ sub factset { } } - my $oldvalue; - if(defined $owner_channel) { my $factoid = $self->{pbot}->{factoids}->{factoids}->hash->{$owner_channel}->{$owner_trigger}; @@ -351,18 +349,12 @@ sub factset { if(lc $nick ne lc $owner and $level == 0) { return "You are not the owner of $trigger."; } - - $oldvalue = $self->{pbot}->{factoids}->{factoids}->hash->{$channel}->{$trigger}->{$key}; } my $result = $self->{pbot}->{factoids}->{factoids}->set($channel, $trigger, $key, $value); 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 { - $self->log_factoid($channel, $trigger, "$nick!$user\@$host", "set $key to $value"); - } + $self->log_factoid($channel, $trigger, "$nick!$user\@$host", "set $key to $value"); } return $result;