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

Fix formatting of username in MuteCommand

This commit is contained in:
Tim Düsterhus 2013-04-20 19:49:06 +02:00
parent db270c25ea
commit 1a1654ae60
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 = '<span class="userLink" data-user-id="'.$this->user->userID.'" />';
$this->link = "[url='".$profile."']".$this->user->username.'[/url]';
$this->executeAction();