From 1a1654ae60d8a52e8cfb3db3c0bc56a16274639e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 20 Apr 2013 19:49:06 +0200 Subject: [PATCH] Fix formatting of username in MuteCommand --- file/lib/data/message/Message.class.php | 6 ++++-- file/lib/system/command/commands/MuteCommand.class.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/file/lib/data/message/Message.class.php b/file/lib/data/message/Message.class.php index 216c186..18f0b1c 100644 --- a/file/lib/data/message/Message.class.php +++ b/file/lib/data/message/Message.class.php @@ -59,6 +59,8 @@ public function __toString() { */ public function getFormattedMessage($type = 'text/html') { $message = $this->message; + $messageParser = \wcf\system\bbcode\MessageParser::getInstance(); + $messageParser->setOutputType('text/html'); switch ($this->type) { case self::TYPE_JOIN: @@ -70,6 +72,8 @@ public function getFormattedMessage($type = 'text/html') { case self::TYPE_MODERATE: $message = unserialize($message); $message = WCF::getLanguage()->getDynamicVariable('chat.message.'.$this->type.'.'.$message['type'], $message ?: array()); + + $message = $messageParser->parse($message, false, false, true, false); break; case self::TYPE_WHISPER: $message = unserialize($message); @@ -79,8 +83,6 @@ public function getFormattedMessage($type = 'text/html') { 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); break; } diff --git a/file/lib/system/command/commands/MuteCommand.class.php b/file/lib/system/command/commands/MuteCommand.class.php index bef3fb8..9a8cd11 100644 --- a/file/lib/system/command/commands/MuteCommand.class.php +++ b/file/lib/system/command/commands/MuteCommand.class.php @@ -41,7 +41,7 @@ public function __construct(\chat\system\command\CommandHandler $commandHandler) $profile = \wcf\system\request\LinkHandler::getInstance()->getLink('User', array( 'object' => $this->user )); - $this->link = ''; + $this->link = "[url='".$profile."']".$this->user->username.'[/url]'; $this->executeAction();