mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-10 00:30:09 +00:00
Fixing didInit event a bit
This commit is contained in:
parent
e2d02dec15
commit
4c05e38d1e
@ -18,6 +18,9 @@ abstract class AbstractCommand implements ICommand {
|
||||
public function __construct(CommandHandler $commandHandler) {
|
||||
EventHandler::getInstance()->fireAction($this, 'shouldInit');
|
||||
$this->commandHandler = $commandHandler;
|
||||
}
|
||||
|
||||
public function didInit() {
|
||||
EventHandler::getInstance()->fireAction($this, 'didInit');
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
\wcf\util\ChatUtil::writeUserData(array('away' => $commandHandler->getParameters()));
|
||||
$this->didInit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,6 +58,7 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan
|
||||
}
|
||||
}
|
||||
\wcf\util\ChatUtil::writeUserData(array('color' => $color));
|
||||
$this->didInit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,13 +13,20 @@
|
||||
class Free extends Me {
|
||||
public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_OFF;
|
||||
|
||||
public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
if (\wcf\util\StringUtil::toLowerCase($this->commandHandler->getParameters()) != 'the fish') {
|
||||
throw new \wcf\system\chat\commands\NotFoundException();
|
||||
}
|
||||
|
||||
$this->didInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\commands\ICommand::getMessage()
|
||||
*/
|
||||
public function getMessage() {
|
||||
if (\wcf\util\StringUtil::toLowerCase($this->commandHandler->getParameters()) == 'the fish')
|
||||
return 'freed the fish. OH A NOEZ';
|
||||
else
|
||||
throw new \wcf\system\chat\commands\NotFoundException();
|
||||
return 'freed the fish. OH A NOEZ';
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ public function __construct(\wcf\system\chat\commands\CommandHandler $commandHan
|
||||
if ($room->roomID && $room->canEnter()) {
|
||||
$this->lines[WCF::getLanguage()->get('wcf.chat.room')] = $room->getTitle();
|
||||
}
|
||||
|
||||
$this->didInit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,6 +14,12 @@
|
||||
class Me extends \wcf\system\chat\commands\AbstractCommand {
|
||||
public $enableSmilies = \wcf\system\chat\commands\ICommand::SMILEY_USER;
|
||||
|
||||
public function __construct(\wcf\system\chat\commands\CommandHandler $commandHandler) {
|
||||
parent::__construct($commandHandler);
|
||||
|
||||
$this->didInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\system\chat\commands\ICommand::getType()
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user