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:
parent
26a90bd98c
commit
bafc678eb4
@ -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')] = '<a href="'.$profile.'">'.ChatUtil::gradient($user->username, $color[1], $color[2]).'</a>';
|
||||
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user