mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Drop enableBBCodes
This commit is contained in:
parent
850ccd65fd
commit
a935eb5f8d
@ -77,25 +77,18 @@ public function getFormattedMessage($outputType = 'text/html') {
|
||||
$message = $message['message'];
|
||||
case self::TYPE_NORMAL:
|
||||
case self::TYPE_ME:
|
||||
if ($this->enableBBCodes) {
|
||||
$messageParser = \wcf\system\bbcode\MessageParser::getInstance();
|
||||
$messageParser->setOutputType($outputType);
|
||||
$message = $messageParser->parse($message, $this->enableSmilies, $this->enableHTML, true, false);
|
||||
}
|
||||
else if (!$this->enableHTML && $outputType == 'text/html') {
|
||||
$message = \wcf\system\bbcode\SimpleMessageParser::getInstance()->parse($message, true, $this->enableSmilies);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ($this->enableHTML) {
|
||||
$message = self::replaceUserLink($message, $outputType);
|
||||
}
|
||||
|
||||
if ($this->enableBBCodes) {
|
||||
$messageParser = \wcf\system\bbcode\MessageParser::getInstance();
|
||||
$messageParser->setOutputType($outputType);
|
||||
$message = $messageParser->parse($message, $this->enableSmilies, $this->enableHTML, true, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ public function validateSend() {
|
||||
$this->readString('text');
|
||||
$this->readBoolean('enableSmilies');
|
||||
$this->parameters['text'] = MessageUtil::stripCrap($this->parameters['text']);
|
||||
$this->parameters['enableHTML'] = false;
|
||||
|
||||
// validate text
|
||||
if (strlen($this->parameters['text']) > CHAT_MAX_LENGTH) throw new UserInputException('text', 'tooLong');
|
||||
@ -85,8 +86,7 @@ public function validateSend() {
|
||||
$command = $commandHandler->loadCommand();
|
||||
|
||||
if ($command->enableSmilies != \chat\system\command\ICommand::SETTING_USER) $this->parameters['enableSmilies'] = $command->enableSmilies;
|
||||
$this->enableHTML = $command->enableHTML;
|
||||
if ($command->enableBBCodes != \chat\system\command\ICommand::SETTING_USER) $this->enableBBCodes = $command->enableBBCodes;
|
||||
$this->parameters['enableHTML'] = $command->enableHTML;
|
||||
|
||||
$this->parameters['type'] = $command->getType();
|
||||
$this->parameters['text'] = $command->getMessage();
|
||||
@ -134,9 +134,8 @@ public function send() {
|
||||
'time' => TIME_NOW,
|
||||
'type' => $this->parameters['type'],
|
||||
'message' => $this->parameters['text'],
|
||||
//'enableSmilies' => $this->enableSmilies,
|
||||
//'enableHTML' => $this->enableHTML,
|
||||
//'enableBBCodes' => $this->enableBBCodes,
|
||||
'enableSmilies' => $this->parameters['enableSmilies'] ? 1 : 0,
|
||||
'enableHTML' => $this->parameters['enableHTML'] ? 1 : 0,
|
||||
'color1' => $this->parameters['userData']['color'][1],
|
||||
'color2' => $this->parameters['userData']['color'][2]
|
||||
)
|
||||
|
@ -28,16 +28,6 @@ abstract class AbstractCommand implements ICommand {
|
||||
*/
|
||||
public $enableHTML = ICommand::SETTING_OFF;
|
||||
|
||||
/**
|
||||
* Should BBCodes be enabled?
|
||||
*
|
||||
* @var integer
|
||||
* @see \chat\system\command\ICommand::SETTING_OFF
|
||||
* @see \chat\system\command\ICommand::SETTING_ON
|
||||
* @see \chat\system\command\ICommand::SETTING_USER
|
||||
*/
|
||||
public $enableBBCodes = ICommand::SETTING_OFF;
|
||||
|
||||
/**
|
||||
* Should smilies be enabled?
|
||||
*
|
||||
|
@ -15,7 +15,6 @@
|
||||
* @subpackage system.chat.command.commands
|
||||
*/
|
||||
class InfoCommand extends \chat\system\command\AbstractCommand {
|
||||
public $enableBBCodes = self::SETTING_ON;
|
||||
public $enableHTML = self::SETTING_ON;
|
||||
public $lines = array();
|
||||
public $user = null;
|
||||
|
@ -12,7 +12,6 @@
|
||||
*/
|
||||
class WhereCommand extends \chat\system\command\AbstractCommand {
|
||||
public $enableHTML = self::SETTING_ON;
|
||||
public $enableBBCodes = self::SETTING_ON;
|
||||
|
||||
/**
|
||||
* @see \chat\system\command\ICommand::getType()
|
||||
|
@ -18,7 +18,6 @@ CREATE TABLE chat1_message (
|
||||
type TINYINT(3) NOT NULL DEFAULT 1,
|
||||
message MEDIUMTEXT NOT NULL,
|
||||
enableSmilies TINYINT(1) NOT NULL DEFAULT 1,
|
||||
enableBBCodes TINYINT(1) NOT NULL DEFAULT 0,
|
||||
enableHTML TINYINT(1) NOT NULL DEFAULT 0,
|
||||
color1 INT(10) NOT NULL DEFAULT 0,
|
||||
color2 INT(10) NOT NULL DEFAULT 0,
|
||||
|
@ -5,7 +5,7 @@
|
||||
<packagedescription><![CDATA[Chat for WoltLab Community Framework™.]]></packagedescription>
|
||||
<packagedescription language="de"><![CDATA[Chat für WoltLab Community Framework™.]]></packagedescription>
|
||||
<isapplication>1</isapplication>
|
||||
<version>3.0.0 Alpha 19</version><!-- Codename: Codenames are overrated -->
|
||||
<version>3.0.0 Alpha 20</version><!-- Codename: Codenames are overrated -->
|
||||
<date>2011-11-26</date>
|
||||
</packageinformation>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user