From d4e6d3faefaa1c7377c756f73e302f2818a7e53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 19 Sep 2014 23:34:17 +0200 Subject: [PATCH] Depend on Push instead of nodePush --- contrib/build.php | 2 -- file/js/be.bastelstu.Chat.litcoffee | 18 +++++++++--------- file/lib/data/message/MessageEditor.class.php | 2 +- file/lib/data/room/Room.class.php | 2 +- file/lib/data/room/RoomAction.class.php | 4 ++-- file/lib/data/room/RoomEditor.class.php | 2 +- package.xml | 2 +- template/chat.tpl | 4 ++-- template/dashboardBoxOnlineList.tpl | 4 ++-- 9 files changed, 19 insertions(+), 21 deletions(-) diff --git a/contrib/build.php b/contrib/build.php index 4bdc314..0658824 100755 --- a/contrib/build.php +++ b/contrib/build.php @@ -27,7 +27,6 @@ if (file_exists('file.tar')) unlink('file.tar'); if (file_exists('template.tar')) unlink('template.tar'); if (file_exists('acptemplate.tar')) unlink('acptemplate.tar'); - foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile); foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile); foreach (glob('file/acp/js/*.js') as $jsFile) unlink($jsFile); if (file_exists('be.bastelstu.chat.tar')) unlink('be.bastelstu.chat.tar'); @@ -133,6 +132,5 @@ if (file_exists('file.tar')) unlink('file.tar'); if (file_exists('template.tar')) unlink('template.tar'); if (file_exists('acptemplate.tar')) unlink('acptemplate.tar'); -foreach (glob('file/acp/be.bastelstu.chat.nodePush/lib/*.js') as $nodeFile) unlink($nodeFile); foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile); foreach (glob('file/acp/js/*.js') as $jsFile) unlink($jsFile); diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index bd941eb..871d64e 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -446,25 +446,25 @@ Initialize the `PeriodicalExecuter`s pe.refreshRoomList = new WCF.PeriodicalExecuter refreshRoomList, 60e3 pe.getMessages = new WCF.PeriodicalExecuter getMessages, v.config.reloadTime * 1e3 -Initialize the [**nodePush**](https://github.com/wbbaddons/nodePush) integration of **Tims Chat**. Once -the browser is connected to **nodePush** periodic message loading will be disabled and **Tims Chat** will +Initialize the [**Push**](https://github.com/wbbaddons/Push) integration of **Tims Chat**. Once +the browser is connected to **Push** periodic message loading will be disabled and **Tims Chat** will load messages if the appropriate event arrives. do -> - be.bastelstu.wcf.nodePush.onConnect -> + be.bastelstu.wcf.push.onConnect -> console.log 'Disabling periodic loading' do pe.getMessages.stop - be.bastelstu.wcf.nodePush.onDisconnect -> + be.bastelstu.wcf.push.onDisconnect -> console.log 'Enabling periodic loading' do getMessages do pe.getMessages.resume - be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.newMessage', getMessages - be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.wcf.nodePush.tick60', getMessages - be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.roomChange', refreshRoomList - be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.join', refreshRoomList - be.bastelstu.wcf.nodePush.onMessage 'be.bastelstu.chat.leave', refreshRoomList + be.bastelstu.wcf.push.onMessage 'be.bastelstu.chat.newMessage', getMessages + be.bastelstu.wcf.push.onMessage 'be.bastelstu.wcf.push.tick60', getMessages + be.bastelstu.wcf.push.onMessage 'be.bastelstu.chat.roomChange', refreshRoomList + be.bastelstu.wcf.push.onMessage 'be.bastelstu.chat.join', refreshRoomList + be.bastelstu.wcf.push.onMessage 'be.bastelstu.chat.leave', refreshRoomList Switch to fullscreen mode on mobile devices diff --git a/file/lib/data/message/MessageEditor.class.php b/file/lib/data/message/MessageEditor.class.php index 28c011a..9047a5e 100644 --- a/file/lib/data/message/MessageEditor.class.php +++ b/file/lib/data/message/MessageEditor.class.php @@ -34,7 +34,7 @@ public static function deleteAll(array $objectIDs = array()) { * Notify the Push-Server. */ public static function create(array $parameters = array()) { - \wcf\system\nodePush\NodePushHandler::getInstance()->sendMessage('be.bastelstu.chat.newMessage'); + \wcf\system\push\PushHandler::getInstance()->sendMessage('be.bastelstu.chat.newMessage'); return parent::create($parameters); } diff --git a/file/lib/data/room/Room.class.php b/file/lib/data/room/Room.class.php index a0cc510..88ed8b8 100644 --- a/file/lib/data/room/Room.class.php +++ b/file/lib/data/room/Room.class.php @@ -217,7 +217,7 @@ public function getUsers() { * @return \wcf\data\user\UserList */ public static function getDeadUsers() { - if (\wcf\system\nodePush\NodePushHandler::getInstance()->isEnabled()) { + if (\wcf\system\push\PushHandler::getInstance()->isEnabled()) { $time = TIME_NOW - 180; } else { diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 267a1c4..d89f81d 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -251,7 +251,7 @@ public function join() { \wcf\system\user\activity\point\UserActivityPointHandler::getInstance()->fireEvent('be.bastelstu.chat.activityPointEvent.join', $result, WCF::getUser()->userID); // send push message about join - \wcf\system\nodePush\NodePushHandler::getInstance()->sendMessage('be.bastelstu.chat.join'); + \wcf\system\push\PushHandler::getInstance()->sendMessage('be.bastelstu.chat.join'); $messages = array(); foreach ($newestMessages as $message) $messages[] = $message->jsonify(true); @@ -318,7 +318,7 @@ public function leave() { 'chatRoomID' => null )); - \wcf\system\nodePush\NodePushHandler::getInstance()->sendMessage('be.bastelstu.chat.leave'); + \wcf\system\push\PushHandler::getInstance()->sendMessage('be.bastelstu.chat.leave'); } /** diff --git a/file/lib/data/room/RoomEditor.class.php b/file/lib/data/room/RoomEditor.class.php index b85701a..bc94ed9 100644 --- a/file/lib/data/room/RoomEditor.class.php +++ b/file/lib/data/room/RoomEditor.class.php @@ -61,6 +61,6 @@ public static function deleteAll(array $objectIDs = array()) { public static function resetCache() { \chat\system\cache\builder\RoomCacheBuilder::getInstance()->reset(); \chat\system\cache\builder\PermissionCacheBuilder::getInstance()->reset(); - \wcf\system\nodePush\NodePushHandler::getInstance()->sendDeferredMessage('be.bastelstu.chat.roomChange'); + \wcf\system\push\PushHandler::getInstance()->sendDeferredMessage('be.bastelstu.chat.roomChange'); } } diff --git a/package.xml b/package.xml index 7060679..065c127 100644 --- a/package.xml +++ b/package.xml @@ -19,7 +19,7 @@ com.woltlab.wcf be.bastelstu.max.wcf.jCounter - be.bastelstu.wcf.nodePush + be.bastelstu.wcf.push diff --git a/template/chat.tpl b/template/chat.tpl index ed4f731..e93377f 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -238,8 +238,8 @@ } }); - be.bastelstu.wcf.nodePush.onMessage('be.bastelstu.chat.join', $.proxy(proxy.sendRequest, proxy)); - be.bastelstu.wcf.nodePush.onMessage('be.bastelstu.chat.leave', $.proxy(proxy.sendRequest, proxy)); + be.bastelstu.wcf.push.onMessage('be.bastelstu.chat.join', $.proxy(proxy.sendRequest, proxy)); + be.bastelstu.wcf.push.onMessage('be.bastelstu.chat.leave', $.proxy(proxy.sendRequest, proxy)); })(jQuery, this); //]]> diff --git a/template/dashboardBoxOnlineList.tpl b/template/dashboardBoxOnlineList.tpl index a7ae617..64fe8ae 100644 --- a/template/dashboardBoxOnlineList.tpl +++ b/template/dashboardBoxOnlineList.tpl @@ -31,8 +31,8 @@ } }); - be.bastelstu.wcf.nodePush.onMessage('be.bastelstu.chat.join', $.proxy(proxy.sendRequest, proxy)); - be.bastelstu.wcf.nodePush.onMessage('be.bastelstu.chat.leave', $.proxy(proxy.sendRequest, proxy)); + be.bastelstu.wcf.push.onMessage('be.bastelstu.chat.join', $.proxy(proxy.sendRequest, proxy)); + be.bastelstu.wcf.push.onMessage('be.bastelstu.chat.leave', $.proxy(proxy.sendRequest, proxy)); })(jQuery, this); //]]>