Skip to content

Commit

Permalink
switches Phergie_Plugin_Command to use $this->getConfig rather than $…
Browse files Browse the repository at this point in the history
…this->config directly
  • Loading branch information
dotEvan authored and elazar committed Apr 1, 2010
1 parent 980e722 commit 6d2fc8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Phergie/Plugin/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ public function onPrivmsg()
// Get the content of the message
$event = $this->getEvent();
$msg = trim($event->getText());
$prefix = $this->getConfig('command.prefix');

// Check for the command prefix if one is set and needed
if ($this->config['command.prefix'] && $event->isInChannel()) {
if (strpos($msg, $this->config['command.prefix']) !== 0) {
if ($prefix && $event->isInChannel()) {
if (strpos($msg, $prefix) !== 0) {
return;
} else {
$msg = substr($msg, strlen($this->config['command.prefix']));
$msg = substr($msg, strlen($prefix));
}
}

Expand Down

0 comments on commit 6d2fc8a

Please sign in to comment.