mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 10:59:29 +01:00
factoids: oops, broke global channel searching, fixed (exact_channel restored)
This commit is contained in:
parent
bede029261
commit
a57394c762
@ -162,7 +162,11 @@ sub find_factoid {
|
|||||||
|
|
||||||
my @result = eval {
|
my @result = eval {
|
||||||
foreach my $channel (sort keys %{ $self->factoids->hash }) {
|
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} }) {
|
foreach my $trigger (keys %{ $self->factoids->hash->{$channel} }) {
|
||||||
if(not $exact_trigger and $self->factoids->hash->{$channel}->{$trigger}->{type} eq 'regex') {
|
if(not $exact_trigger and $self->factoids->hash->{$channel}->{$trigger}->{type} eq 'regex') {
|
||||||
@ -361,7 +365,7 @@ sub interpreter {
|
|||||||
$result =~ s/\$args/$nick/gi;
|
$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;
|
$result =~ s/\$nick/$nick/g;
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ 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 => 319,
|
BUILD_REVISION => 320,
|
||||||
BUILD_DATE => "2011-02-13",
|
BUILD_DATE => "2011-02-14",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user