Skip to content

Commit

Permalink
Fix test failure for 'nick msg' case.
Browse files Browse the repository at this point in the history
Fixed Phergie_Plugin_Message->getMessage() for the test case where
whitespace is used as the delimiter between bot nick and the
message when explicitly addressed.
  • Loading branch information
dossy authored and avdg committed Oct 28, 2011
1 parent d8b63f2 commit 5cf9049
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Phergie/Plugin/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function isTargetedMessage()

$targetPattern = <<<REGEX
{^
\s*{$self}\s*[:>,].* # expect the bots name, followed by a [:>,]
\s*{$self}\s*[:>,\s].* # expect the bots name, followed by a [:>,\s]
$}ix
REGEX;

Expand Down Expand Up @@ -88,7 +88,7 @@ public function getMessage()
$prefixPattern = <<<REGEX
{^
(?:
\s*{$self}\s*[:>,]\s* # start with bot name
\s*{$self}\s*[:>,\s]\s* # start with bot name
(?:{$prefix})? # which is optionally followed by the prefix
|
\s*{$prefix} # or start with the prefix
Expand All @@ -101,7 +101,7 @@ public function getMessage()
// : command <parameters>
$noPrefixPattern = <<<REGEX
{^
\s*(?:{$self}\s*[:>,]\s*)? # optionally start with the bot name
\s*(?:{$self}\s*[:>,\s]\s*)? # optionally start with the bot name
(.*?) # always end with the message
$}ix
REGEX;
Expand Down

0 comments on commit 5cf9049

Please sign in to comment.