diff --git a/file/lib/system/chat/command/commands/Where.class.php b/file/lib/system/chat/command/commands/Where.class.php new file mode 100644 index 0000000..e2a2eb5 --- /dev/null +++ b/file/lib/system/chat/command/commands/Where.class.php @@ -0,0 +1,52 @@ + + * @package timwolla.wcf.chat + * @subpackage system.chat.command.commands + */ +class Where extends \wcf\system\chat\command\AbstractCommand { + public $enableSmilies = \wcf\system\chat\command\ICommand::SMILEY_OFF; + public $enableHTML = 1; + + /** + * @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() { + $rooms = \wcf\data\chat\room\ChatRoom::getCache(); + + foreach ($rooms as $room) { + $users = $room->getUsers(); + $tmp = array(); + foreach ($users as $user) { + $profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array( + 'object' => $user + )); + + $tmp[] = ''.$user.''; + } + if (!empty($tmp)) $lines[] = ''.$room.': '.implode(', ', $tmp); + } + + return ''; + } + + /** + * @see \wcf\system\chat\command\ICommand::getReceiver() + */ + public function getReceiver() { + return \wcf\system\WCF::getUser()->userID; + } +}