1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 22:35:43 -04:00

some more tweaks

This commit is contained in:
Ryan Voots 2010-03-12 20:23:21 -05:00
parent c74027840e
commit 4c3063822e
2 changed files with 4 additions and 8 deletions

View file

@ -324,10 +324,6 @@ sub get_fact_literal {
return _fact_literal_format($fact); return _fact_literal_format($fact);
} }
sub _fact_substitute_global
{
}
sub _fact_substitute sub _fact_substitute
{ {
my ($self, $pred, $match, $subst, $flags) = @_; my ($self, $pred, $match, $subst, $flags) = @_;
@ -393,7 +389,7 @@ sub get_fact_substitute {
# $body =~ s/^\s*learn\s+//; # $body =~ s/^\s*learn\s+//;
# my( $subject, $predicate ) = split /\s+as\s+/, $body, 2; # my( $subject, $predicate ) = split /\s+as\s+/, $body, 2;
$self->get_fact_learn("learn $subject as $result"); $self->get_fact_learn("learn $subject as $result", $name, $said, $subject, $result);
return "learned $subject as $result"; return "learned $subject as $result";
} }
@ -439,10 +435,10 @@ sub get_fact_revert {
} }
sub get_fact_learn { sub get_fact_learn {
my( $self, $body, $name, $said ) = @_; my( $self, $body, $name, $said, $subject, $predicate ) = @_;
$body =~ s/^\s*learn\s+//; $body =~ s/^\s*learn\s+//;
my( $subject, $predicate ) = split /\s+as\s+/, $body, 2; ($subject, $predicate ) = split /\s+as\s+/, $body, 2 unless ($subject && $predicate);
#XXX check permissions here #XXX check permissions here
return "Insufficient permissions for changing protected factoid [$subject]" if (!$self->_db_check_perm($subject,$said)); return "Insufficient permissions for changing protected factoid [$subject]" if (!$self->_db_check_perm($subject,$said));

View file

@ -1,6 +1,6 @@
use Geo::IP; use Geo::IP;
no warnings 'void'; no warnings 'void', 'once';
sub { sub {
my( $said, $pm ) = @_; my( $said, $pm ) = @_;