1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Insert Topic-Message

This commit is contained in:
Tim Düsterhus 2011-11-28 21:40:37 +01:00
parent 3f3fc9e130
commit 66f9cd2ec7

View File

@ -19,6 +19,7 @@ class ChatPage extends AbstractPage {
public $chatVersion = '';
//public $neededModules = array('CHAT_ACTIVE');
//public $neededPermissions = array('user.chat.canEnter');
public $joinMessage = null;
public $room = null;
public $roomID = 0;
public $rooms = array();
@ -33,6 +34,7 @@ public function assignVariables() {
WCF::getTPL()->assign(array(
'chatVersion' => $this->chatVersion,
'joinMessage' => $this->joinMessage,
'room' => $this->room,
'roomID' => $this->roomID,
'rooms' => $this->rooms,
@ -65,18 +67,25 @@ public function readData() {
$this->readRoom();
$this->readUserData();
chat\message\ChatMessageEditor::create(array(
$this->joinMessage = chat\message\ChatMessageEditor::create(array(
'roomID' => $this->room->roomID,
'sender' => WCF::getUser()->userID,
'username' => WCF::getUser()->username,
'time' => TIME_NOW,
'type' => chat\message\ChatMessage::TYPE_JOIN,
'message' => 'join',
'enableSmilies' => 0,
'enableHTML' => 0,
'message' => '',
'color1' => $this->userData['color'][1],
'color2' => $this->userData['color'][2]
));
if ($this->room->topic != '') {
chat\message\ChatMessageEditor::create(array(
'roomID' => $this->room->roomID,
'sender' => WCF::getUser()->userID,
'time' => TIME_NOW,
'type' => chat\message\ChatMessage::TYPE_INFORMATION,
'message' => WCF::getLanguage()->getDynamicVariable($this->room->topic)
));
}
$this->readDefaultSmileys();
$this->readChatVersion();