From 47bce1e4aa9d1254043abdff633b0ccfd725b0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 18 Oct 2014 19:30:03 +0200 Subject: [PATCH] Fix chat room pruning --- file/lib/data/room/RoomAction.class.php | 18 +++++++----------- file/lib/util/ChatUtil.class.php | 1 - 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 267a1c4..8ba22aa 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -69,16 +69,12 @@ public function prune() { WHERE permanent = ? AND roomID NOT IN ( - SELECT - fieldValue AS roomID - FROM - wcf".WCF_N."_user_storage - WHERE - field = ? - AND fieldValue IS NOT NULL - )"; + SELECT chatRoomID + FROM wcf".WCF_N."_user + WHERE chatRoomID IS NOT NULL + )"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); - $stmt->execute(array(0, 'roomID')); + $stmt->execute(array(0)); $objectIDs = array(); while ($objectID = $stmt->fetchColumn()) $objectIDs[] = $objectID; @@ -251,7 +247,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 +314,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/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index b9c1f2f..06c50a5 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -1,7 +1,6 @@