mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Adding ChatMessageAction
This commit is contained in:
parent
04a6570bb4
commit
510ee9645e
18
file/lib/data/chat/message/ChatMessageAction.class.php
Normal file
18
file/lib/data/chat/message/ChatMessageAction.class.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wcf\data\chat\message;
|
||||
|
||||
/**
|
||||
* Executes message related actions.
|
||||
*
|
||||
* @author Tim Düsterhus
|
||||
* @copyright 2010-2011 Tim Düsterhus
|
||||
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
||||
* @package timwolla.wcf.chat
|
||||
* @subpackage data.chat.message
|
||||
*/
|
||||
class ChatMessageAction extends \wcf\data\AbstractDatabaseObjectAction {
|
||||
/**
|
||||
* @see wcf\data\AbstractDatabaseObjectAction::$className
|
||||
*/
|
||||
protected $className = '\wcf\data\chat\message\ChatMessageEditor';
|
||||
}
|
@ -19,7 +19,6 @@ class ChatPage extends AbstractPage {
|
||||
public $chatVersion = '';
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $joinMessage = null;
|
||||
public $newestMessages = array();
|
||||
public $room = null;
|
||||
public $roomID = 0;
|
||||
@ -35,7 +34,6 @@ public function assignVariables() {
|
||||
|
||||
WCF::getTPL()->assign(array(
|
||||
'chatVersion' => $this->chatVersion,
|
||||
'joinMessage' => $this->joinMessage,
|
||||
'newestMessages' => $this->newestMessages,
|
||||
'room' => $this->room,
|
||||
'roomID' => $this->roomID,
|
||||
@ -70,7 +68,8 @@ public function readData() {
|
||||
$this->readRoom();
|
||||
$this->readUserData();
|
||||
if (CHAT_DISPLAY_JOIN_LEAVE) {
|
||||
$this->joinMessage = chat\message\ChatMessageEditor::create(array(
|
||||
$messageAction = new chat\message\ChatMessageAction(array(), 'create', array(
|
||||
'data' => array(
|
||||
'roomID' => $this->room->roomID,
|
||||
'sender' => WCF::getUser()->userID,
|
||||
'username' => WCF::getUser()->username,
|
||||
@ -79,7 +78,9 @@ public function readData() {
|
||||
'message' => '',
|
||||
'color1' => $this->userData['color'][1],
|
||||
'color2' => $this->userData['color'][2]
|
||||
)
|
||||
));
|
||||
$messageAction->executeAction();
|
||||
}
|
||||
|
||||
$this->readDefaultSmileys();
|
||||
|
Loading…
Reference in New Issue
Block a user