Fix interpretation of /me commands

This commit is contained in:
Pragmatic Software 2013-07-24 12:33:19 +00:00
parent 2a62729fcc
commit 553eceeb77
2 changed files with 13 additions and 11 deletions

View File

@ -95,28 +95,30 @@ sub process_line {
$from = lc $from if defined $from;
$text =~ s/^\s+//;
$text =~ s/\s+$//;
my $pbot = $self->pbot;
$pbot->antiflood->check_flood($from, $nick, $user, $host, $text, $pbot->{MAX_FLOOD_MESSAGES}, 10, $pbot->antiflood->{FLOOD_CHAT}) if defined $from;
$text =~ s/^\s+//;
$text =~ s/\s+$//;
my $preserve_whitespace = 0;
if($text =~ /^\Q$pbot->{trigger}\E(.*)$/) {
my $cmd_text = $text;
$cmd_text =~ s/^\/me\s+//;
if($cmd_text =~ /^\Q$pbot->{trigger}\E(.*)$/) {
$command = $1;
} elsif($text =~ /^.?$mynick.?\s+(.*?)$/i) {
} elsif($cmd_text =~ /^.?$mynick.?\s+(.*?)$/i) {
$command = $1;
} elsif($text =~ /^(.*?),?\s+$mynick[?!.]*$/i) {
} elsif($cmd_text =~ /^(.*?),?\s+$mynick[?!.]*$/i) {
$command = $1;
} elsif($text =~ /https?:\/\/([^\s]+)/i) {
} elsif($cmd_text =~ /https?:\/\/([^\s]+)/i) {
$has_url = $1;
} elsif($text =~ /^\s*([^,:\(\)\+\*\/ ]+)[,:]*\s*{\s*(.*)\s*}\s*$/) {
} elsif($cmd_text =~ /^\s*([^,:\(\)\+\*\/ ]+)[,:]*\s*{\s*(.*)\s*}\s*$/) {
$nick_override = $1;
$has_code = $2 if length $2 and $nick_override ne 'enum' and $nick_override ne 'struct';
$preserve_whitespace = 1;
} elsif($text =~ /^\s*{\s*(.*)\s*}\s*$/) {
} elsif($cmd_text =~ /^\s*{\s*(.*)\s*}\s*$/) {
$has_code = $1 if length $1;
$preserve_whitespace = 1;
}

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 409,
BUILD_DATE => "2013-06-17",
BUILD_REVISION => 410,
BUILD_DATE => "2013-07-24",
};
1;