2011-11-27 11:21:58 +00:00
|
|
|
<?php
|
2013-01-19 19:36:40 +00:00
|
|
|
namespace chat\data\message;
|
2011-11-27 11:21:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides functions to edit chat messages.
|
|
|
|
*
|
|
|
|
* @author Tim Düsterhus
|
2013-01-19 19:36:40 +00:00
|
|
|
* @copyright 2010-2013 Tim Düsterhus
|
2011-11-27 11:21:58 +00:00
|
|
|
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
2013-01-19 19:36:40 +00:00
|
|
|
* @package be.bastelstu.chat
|
|
|
|
* @subpackage chat.message
|
2011-11-27 11:21:58 +00:00
|
|
|
*/
|
2013-01-19 19:36:40 +00:00
|
|
|
class MessageEditor extends \wcf\data\DatabaseObjectEditor {
|
2011-11-27 11:21:58 +00:00
|
|
|
/**
|
2012-02-26 16:55:44 +00:00
|
|
|
* @see \wcf\data\DatabaseObjectDecorator::$baseClass
|
2011-11-27 11:21:58 +00:00
|
|
|
*/
|
2013-01-19 19:36:40 +00:00
|
|
|
protected static $baseClass = '\chat\data\message\Message';
|
2011-11-27 11:21:58 +00:00
|
|
|
|
2012-04-27 17:33:28 +00:00
|
|
|
/**
|
|
|
|
* Notify the Push-Server.
|
|
|
|
*/
|
|
|
|
public static function create(array $parameters = array()) {
|
|
|
|
try {
|
2013-01-19 19:36:40 +00:00
|
|
|
if (\chat\util\ChatUtil::nodePushRunning()) {
|
|
|
|
$sock = stream_socket_client('unix://'.CHAT_DIR.'acp/be.bastelstu.chat.nodePush/data.sock', $errno, $errstr, 1);
|
2012-04-30 18:51:27 +00:00
|
|
|
fclose($sock);
|
2012-04-27 17:33:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (\Exception $e) { }
|
|
|
|
|
|
|
|
return parent::create($parameters);
|
|
|
|
}
|
2011-11-27 11:21:58 +00:00
|
|
|
}
|