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 $chatVersion = '';
|
||||||
public $neededModules = array('CHAT_ACTIVE');
|
public $neededModules = array('CHAT_ACTIVE');
|
||||||
//public $neededPermissions = array('user.chat.canEnter');
|
//public $neededPermissions = array('user.chat.canEnter');
|
||||||
public $joinMessage = null;
|
|
||||||
public $newestMessages = array();
|
public $newestMessages = array();
|
||||||
public $room = null;
|
public $room = null;
|
||||||
public $roomID = 0;
|
public $roomID = 0;
|
||||||
@ -35,7 +34,6 @@ public function assignVariables() {
|
|||||||
|
|
||||||
WCF::getTPL()->assign(array(
|
WCF::getTPL()->assign(array(
|
||||||
'chatVersion' => $this->chatVersion,
|
'chatVersion' => $this->chatVersion,
|
||||||
'joinMessage' => $this->joinMessage,
|
|
||||||
'newestMessages' => $this->newestMessages,
|
'newestMessages' => $this->newestMessages,
|
||||||
'room' => $this->room,
|
'room' => $this->room,
|
||||||
'roomID' => $this->roomID,
|
'roomID' => $this->roomID,
|
||||||
@ -70,16 +68,19 @@ public function readData() {
|
|||||||
$this->readRoom();
|
$this->readRoom();
|
||||||
$this->readUserData();
|
$this->readUserData();
|
||||||
if (CHAT_DISPLAY_JOIN_LEAVE) {
|
if (CHAT_DISPLAY_JOIN_LEAVE) {
|
||||||
$this->joinMessage = chat\message\ChatMessageEditor::create(array(
|
$messageAction = new chat\message\ChatMessageAction(array(), 'create', array(
|
||||||
'roomID' => $this->room->roomID,
|
'data' => array(
|
||||||
'sender' => WCF::getUser()->userID,
|
'roomID' => $this->room->roomID,
|
||||||
'username' => WCF::getUser()->username,
|
'sender' => WCF::getUser()->userID,
|
||||||
'time' => TIME_NOW,
|
'username' => WCF::getUser()->username,
|
||||||
'type' => chat\message\ChatMessage::TYPE_JOIN,
|
'time' => TIME_NOW,
|
||||||
'message' => '',
|
'type' => chat\message\ChatMessage::TYPE_JOIN,
|
||||||
'color1' => $this->userData['color'][1],
|
'message' => '',
|
||||||
'color2' => $this->userData['color'][2]
|
'color1' => $this->userData['color'][1],
|
||||||
|
'color2' => $this->userData['color'][2]
|
||||||
|
)
|
||||||
));
|
));
|
||||||
|
$messageAction->executeAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->readDefaultSmileys();
|
$this->readDefaultSmileys();
|
||||||
|
Loading…
Reference in New Issue
Block a user