From bafc678eb4a784a71fd377e7055932dcf87c90fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 15 Apr 2012 14:09:51 +0200 Subject: [PATCH] Adding Profile-Link to info --- .../system/chat/command/commands/Info.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/file/lib/system/chat/command/commands/Info.class.php b/file/lib/system/chat/command/commands/Info.class.php index 3bcfd48..52f8264 100644 --- a/file/lib/system/chat/command/commands/Info.class.php +++ b/file/lib/system/chat/command/commands/Info.class.php @@ -24,16 +24,26 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand $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]); + // Username + link to profile + $color = ChatUtil::readUserData('color', $user); + $profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array( + 'object' => $user + )); + $this->lines[WCF::getLanguage()->get('wcf.user.username')] = ''.ChatUtil::gradient($user->username, $color[1], $color[2]).''; + + // Away-Status if (ChatUtil::readUserData('away', $user) !== null) { $this->lines[WCF::getLanguage()->get('wcf.chat.away')] = ChatUtil::readUserData('away', $user); } + + // Room + $room = new \wcf\data\chat\room\ChatRoom(ChatUtil::readUserData('roomID', $user)); if ($room->roomID && $room->canEnter()) { $this->lines[WCF::getLanguage()->get('wcf.chat.room')] = $room->getTitle(); } + + // IP-Address $session = $this->fetchSession($user); if ($session) { // TODO: Check permission