From edff4b6c4c31ac0f2ca64a40a023458574d8151a Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 31 Jul 2013 13:48:50 +0000 Subject: [PATCH] Update ref_user to use full hostmask instead of just nick; add edited_by/edited_on to factoid metadata levels hash --- PBot/FactoidCommands.pm | 2 ++ PBot/Factoids.pm | 6 +++--- PBot/VERSION.pm | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index 5127f0cd..f356d5e4 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -39,6 +39,8 @@ my %factoid_metadata_levels = ( ref_count => 60, ref_user => 60, type => 60, + edited_by => 60, + edited_on => 60, # all others are allowed to be factset by anybody/default to level 0 ); diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index c916726a..2aca3074 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -297,7 +297,7 @@ sub interpreter { $pbot->logger->log("[" . (defined $from ? $from : "stdin") . "] ($nick!$user\@$host) [$keyword] aliased to: [$command]\n"); $self->factoids->hash->{$channel}->{$keyword}->{ref_count}++; - $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = $nick; + $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = "$nick!$user\@$host"; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_on} = gettimeofday; return $pbot->interpreter->interpret($from, $nick, $user, $host, $count, $command, $tonick); @@ -325,7 +325,7 @@ sub interpreter { $self->{pbot}->logger->log("Found module\n"); $self->factoids->hash->{$channel}->{$keyword}->{ref_count}++; - $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = $nick; + $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = "$nick!$user\@$host"; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_on} = gettimeofday; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_in} = $from || "stdin"; @@ -341,7 +341,7 @@ sub interpreter { } $self->factoids->hash->{$channel}->{$keyword}->{ref_count}++; - $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = $nick; + $self->factoids->hash->{$channel}->{$keyword}->{ref_user} = "$nick!$user\@$host"; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_on} = gettimeofday; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_in} = $from || "stdin"; diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index b6b06601..048fa0ac 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 417, + BUILD_REVISION => 418, BUILD_DATE => "2013-07-31", };