diff --git a/file/lib/system/chat/commands/CommandHandler.class.php b/file/lib/system/chat/commands/CommandHandler.class.php index 56271d5..a0b5406 100644 --- a/file/lib/system/chat/commands/CommandHandler.class.php +++ b/file/lib/system/chat/commands/CommandHandler.class.php @@ -32,6 +32,17 @@ public function isCommand($text = null) { return StringUtil::substring($text, 0, StringUtil::length(static::COMMAND_CHAR)) == static::COMMAND_CHAR; } + /** + * Returns the parameter-string. + * + * @return string + */ + public function getParameters() { + $parts = explode(' ', StringUtil::substring($this->text, StringUtil::length(static::COMMAND_CHAR)), 2); + + return $parts[1]; + } + /** * Loads the command. */ diff --git a/file/lib/system/chat/commands/commands/Free.class.php b/file/lib/system/chat/commands/commands/Free.class.php index a6bfdfe..4ed581c 100644 --- a/file/lib/system/chat/commands/commands/Free.class.php +++ b/file/lib/system/chat/commands/commands/Free.class.php @@ -10,14 +10,13 @@ * @package timwolla.wcf.chat * @subpackage system.chat.commands.commands */ -class Free extends \wcf\system\chat\commands\AbstractCommand { - const ENABLE_SMILIES = \wcf\system\chat\commands\ICommand::SMILEY_USER; - - public function getType() { - return \wcf\data\chat\message\ChatMessage::TYPE_ME; - } +class Free extends Me { + const ENABLE_SMILIES = \wcf\system\chat\commands\ICommand::SMILEY_OFF; + /** + * @see \wcf\system\chat\commands\ICommand::getMessage() + */ public function getMessage() { - return 'freed the fish'; + return 'freed the fish. OH A NOEZ'; } } diff --git a/file/lib/system/chat/commands/commands/Me.class.php b/file/lib/system/chat/commands/commands/Me.class.php new file mode 100644 index 0000000..c0e79c8 --- /dev/null +++ b/file/lib/system/chat/commands/commands/Me.class.php @@ -0,0 +1,30 @@ + + * @package timwolla.wcf.chat + * @subpackage system.chat.commands.commands + */ +class Me extends \wcf\system\chat\commands\AbstractCommand { + const ENABLE_SMILIES = \wcf\system\chat\commands\ICommand::SMILEY_USER; + + /** + * @see \wcf\system\chat\commands\ICommand::getType() + */ + public function getType() { + return \wcf\data\chat\message\ChatMessage::TYPE_ME; + } + + /** + * @see \wcf\system\chat\commands\ICommand::getMessage() + */ + public function getMessage() { + return$this->commandHandler->getParameters(); + } +}