1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Reposition preparser

This commit is contained in:
Tim Düsterhus 2013-03-19 18:36:27 +01:00
parent 19e168c6a6
commit 64a7578ab1
4 changed files with 9 additions and 4 deletions

View File

@ -121,9 +121,10 @@ public function validateSend() {
else {
$this->parameters['type'] = Message::TYPE_NORMAL;
$this->parameters['receiver'] = null;
$this->parameters['text'] = \wcf\system\bbcode\PreParser::getInstance()->parse($this->parameters['text'], explode(',', WCF::getSession()->getPermission('user.chat.allowedBBCodes')));
}
$this->parameters['text'] = \wcf\system\bbcode\PreParser::getInstance()->parse($this->parameters['text'], explode(',', WCF::getSession()->getPermission('user.chat.allowedBBCodes')));
}
/**

View File

@ -30,7 +30,9 @@ public function getType() {
* @see \chat\system\command\ICommand::getMessage()
*/
public function getMessage() {
return serialize(array('message' => $this->commandHandler->getParameters()));
return serialize(array(
'message' => \wcf\system\bbcode\PreParser::getInstance()->parse($this->commandHandler->getParameters(), explode(',', \wcf\system\WCF::getSession()->getPermission('user.chat.allowedBBCodes')))
));
}
/**

View File

@ -24,7 +24,7 @@ public function getType() {
* @see \chat\system\command\ICommand::getMessage()
*/
public function getMessage() {
return \wcf\util\StringUtil::substring($this->commandHandler->getText(), 1);
return \wcf\system\bbcode\PreParser::getInstance()->parse(\wcf\util\StringUtil::substring($this->commandHandler->getText(), 1), explode(',', \wcf\system\WCF::getSession()->getPermission('user.chat.allowedBBCodes')));
}
/**

View File

@ -43,6 +43,8 @@ public function getType() {
* @see \chat\system\command\ICommand::getMessage()
*/
public function getMessage() {
$this->message = \wcf\system\bbcode\PreParser::getInstance()->parse($this->message, explode(',', \wcf\system\WCF::getSession()->getPermission('user.chat.allowedBBCodes')));
return serialize(array('message' => $this->message, 'username' => $this->user->username));
}