* @package be.bastelstu.chat * @subpackage system.chat.command.commands */ class WhereCommand extends \chat\system\command\AbstractCommand { public $enableHTML = self::SETTING_ON; public $enableBBCodes = self::SETTING_ON; /** * @see \chat\system\command\ICommand::getType() */ public function getType() { return \wcf\data\chat\message\ChatMessage::TYPE_INFORMATION; } /** * @see \chat\system\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) { $tmp[] = ''; } if (!empty($tmp)) $lines[] = '[b]'.$room.':[/b] '.implode(', ', $tmp); } return '[list][*]'.implode('[*]', $lines).'[/list]'; } /** * @see \chat\system\command\ICommand::getReceiver() */ public function getReceiver() { return \wcf\system\WCF::getUser()->userID; } }