3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

Update ref_user to use full hostmask instead of just nick; add edited_by/edited_on to factoid metadata levels hash

This commit is contained in:
Pragmatic Software 2013-07-31 13:48:50 +00:00
parent d2d5695dda
commit edff4b6c4c
3 changed files with 6 additions and 4 deletions

View File

@ -39,6 +39,8 @@ my %factoid_metadata_levels = (
ref_count => 60, ref_count => 60,
ref_user => 60, ref_user => 60,
type => 60, type => 60,
edited_by => 60,
edited_on => 60,
# all others are allowed to be factset by anybody/default to level 0 # all others are allowed to be factset by anybody/default to level 0
); );

View File

@ -297,7 +297,7 @@ sub interpreter {
$pbot->logger->log("[" . (defined $from ? $from : "stdin") . "] ($nick!$user\@$host) [$keyword] aliased to: [$command]\n"); $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_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_on} = gettimeofday;
return $pbot->interpreter->interpret($from, $nick, $user, $host, $count, $command, $tonick); 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->{pbot}->logger->log("Found module\n");
$self->factoids->hash->{$channel}->{$keyword}->{ref_count}++; $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_on} = gettimeofday;
$self->factoids->hash->{$channel}->{$keyword}->{last_referenced_in} = $from || "stdin"; $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_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_on} = gettimeofday;
$self->factoids->hash->{$channel}->{$keyword}->{last_referenced_in} = $from || "stdin"; $self->factoids->hash->{$channel}->{$keyword}->{last_referenced_in} = $from || "stdin";

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 417, BUILD_REVISION => 418,
BUILD_DATE => "2013-07-31", BUILD_DATE => "2013-07-31",
}; };