3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

factoids: oops, broke global channel searching, fixed (exact_channel restored)

This commit is contained in:
Pragmatic Software 2011-02-14 08:09:50 +00:00
parent bede029261
commit a57394c762
2 changed files with 8 additions and 4 deletions

View File

@ -162,7 +162,11 @@ sub find_factoid {
my @result = eval {
foreach my $channel (sort keys %{ $self->factoids->hash }) {
next unless lc $from eq lc $channel;
if($exact_channel) {
next unless lc $from eq lc $channel;
} else {
next unless $from =~ m/^$channel$/i;
}
foreach my $trigger (keys %{ $self->factoids->hash->{$channel} }) {
if(not $exact_trigger and $self->factoids->hash->{$channel}->{$trigger}->{type} eq 'regex') {
@ -361,7 +365,7 @@ sub interpreter {
$result =~ s/\$args/$nick/gi;
}
$self->{pbot}->logger->log("(" . (defined $from ? $from : "(undef)") . "): $nick!$user\@$host): $keyword: Displaying text \"" . $self->factoids->hash->{$channel}->{$keyword}->{action} . "\"\n");
$self->{pbot}->logger->log("(" . (defined $from ? $from : "(undef)") . "): $nick!$user\@$host): $keyword: Displaying text \"" . $result . "\"\n");
$result =~ s/\$nick/$nick/g;

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 319,
BUILD_DATE => "2011-02-13",
BUILD_REVISION => 320,
BUILD_DATE => "2011-02-14",
};
1;