mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Fix text/plain output
This commit is contained in:
parent
4ff62179df
commit
6f02c6c787
@ -57,7 +57,7 @@ public function __toString() {
|
||||
* @param string $outputType outputtype for messageparser
|
||||
* @return string
|
||||
*/
|
||||
public function getFormattedMessage() {
|
||||
public function getFormattedMessage($type = 'text/html') {
|
||||
$message = $this->message;
|
||||
|
||||
switch ($this->type) {
|
||||
@ -77,6 +77,8 @@ public function getFormattedMessage() {
|
||||
case self::TYPE_NORMAL:
|
||||
case self::TYPE_ME:
|
||||
default:
|
||||
if ($type !== 'text/html') return $message;
|
||||
|
||||
$messageParser = \wcf\system\bbcode\MessageParser::getInstance();
|
||||
$messageParser->setOutputType('text/html');
|
||||
$message = $messageParser->parse($message, $this->enableSmilies, $this->enableHTML, true, false);
|
||||
@ -133,7 +135,7 @@ public function jsonify($raw = false) {
|
||||
'formattedMessage' => $this->getFormattedMessage(),
|
||||
'formattedTime' => \wcf\util\DateUtil::format(\wcf\util\DateUtil::getDateTimeByTimestamp($this->time), 'H:i:s'),
|
||||
'separator' => $separator,
|
||||
'message' => $this->message,
|
||||
'message' => $this->getFormattedMessage('text/plain'),
|
||||
'sender' => (int) $this->sender,
|
||||
'username' => $this->getUsername(),
|
||||
'time' => (int) $this->time,
|
||||
|
Loading…
Reference in New Issue
Block a user