1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Adding Profile-Link to info

This commit is contained in:
Tim Düsterhus 2012-04-15 14:09:51 +02:00
parent 26a90bd98c
commit bafc678eb4

View File

@ -24,16 +24,26 @@ public function __construct(\wcf\system\chat\command\CommandHandler $commandHand
$user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ',')); $user = User::getUserByUsername(rtrim($commandHandler->getParameters(), ','));
if (!$user->userID) throw new \wcf\system\chat\command\UserNotFoundException(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')] = '<a href="'.$profile.'">'.ChatUtil::gradient($user->username, $color[1], $color[2]).'</a>';
// Away-Status
if (ChatUtil::readUserData('away', $user) !== null) { if (ChatUtil::readUserData('away', $user) !== null) {
$this->lines[WCF::getLanguage()->get('wcf.chat.away')] = ChatUtil::readUserData('away', $user); $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()) { if ($room->roomID && $room->canEnter()) {
$this->lines[WCF::getLanguage()->get('wcf.chat.room')] = $room->getTitle(); $this->lines[WCF::getLanguage()->get('wcf.chat.room')] = $room->getTitle();
} }
// IP-Address
$session = $this->fetchSession($user); $session = $this->fetchSession($user);
if ($session) { if ($session) {
// TODO: Check permission // TODO: Check permission