Improve wildcard handling

This commit is contained in:
Pragmatic Software 2014-05-31 01:08:01 +00:00
parent 4696df7ea1
commit b9433127d1
3 changed files with 10 additions and 8 deletions

View File

@ -472,10 +472,8 @@ sub recall_message_by_count {
sub recall_message_by_text {
my ($self, $id, $channel, $text, $ignore_command) = @_;
$text =~ s/\.\*\?/%/g;
$text =~ s/\.\*/%/g;
$text =~ s/\*/%/g;
$text =~ s/\?/_/g;
$text =~ s/\.?\*\??/%/g;
$text =~ s/\./_/g;
my $messages;

View File

@ -101,9 +101,13 @@ sub get_quotegrab {
sub get_random_quotegrab {
my ($self, $nick, $channel, $text) = @_;
$nick =~ s/\.?\*/%/g if defined $nick;
$channel =~ s/\.?\*/%/g if defined $channel;
$text =~ s/\.?\*/%/g if defined $text;
$nick =~ s/\.?\*\??/%/g if defined $nick;
$channel =~ s/\.?\*\??/%/g if defined $channel;
$text =~ s/\.?\*\??/%/g if defined $text;
$nick =~ s/\./_/g if defined $nick;
$channel =~ s/\./_/g if defined $channel;
$text =~ s/\./_/g if defined $text;
my $quotegrab = eval {
my $sql = 'SELECT * FROM Quotegrabs ';

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 606,
BUILD_REVISION => 607,
BUILD_DATE => "2014-05-30",
};