* @package timwolla.wcf.chat * @subpackage system.chat.command.commands */ class Info extends \wcf\system\chat\command\AbstractCommand { public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; public $enableHTML = 1; private $lines = array(); public function __construct(\wcf\system\chat\command\CommandHandler $commandHandler) { parent::__construct($commandHandler); $user = \wcf\data\user\User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); if (!$user->userID) throw new \wcf\system\chat\command\UserNotFoundException(rtrim($commandHandler->getParameters(), ',')); $room = new \wcf\data\chat\room\ChatRoom(ChatUtil::readUserData('roomID', $user)); $color = ChatUtil::readUserData('color', $user); $this->lines[WCF::getLanguage()->get('wcf.user.username')] = ChatUtil::gradient($user->username, $color[1], $color[2]); if (ChatUtil::readUserData('away', $user) !== null) { $this->lines[WCF::getLanguage()->get('wcf.chat.away')] = ChatUtil::readUserData('away', $user); } if ($room->roomID && $room->canEnter()) { $this->lines[WCF::getLanguage()->get('wcf.chat.room')] = $room->getTitle(); } $this->didInit(); } /** * @see \wcf\system\chat\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** * @see \wcf\system\chat\command\ICommand::getMessage() */ public function getMessage() { $lines = array(); foreach ($this->lines as $key => $val) { $lines[] = ''.$key.': '.$val; } return '