mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Merge branch 'master' into chatTemplate
This commit is contained in:
commit
7def9d4efd
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace wcf\data\chat\message;
|
namespace wcf\data\chat\message;
|
||||||
|
use \wcf\system\WCF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a chat message.
|
* Represents a chat message.
|
||||||
@ -40,7 +41,23 @@ class ChatMessage extends \wcf\data\DatabaseObject {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
return $this->message;
|
return $this->getFormattedMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the formatted message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFormattedMessage() {
|
||||||
|
$message = $this->message;
|
||||||
|
switch ($this->type) {
|
||||||
|
case self::TYPE_JOIN:
|
||||||
|
case self::TYPE_LEAVE:
|
||||||
|
case self::TYPE_BACK:
|
||||||
|
$message = WCF::getLanguage()->get('wcf.chat.message.'.$this->type);
|
||||||
|
}
|
||||||
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user