From 3248b14097ff4f6c18a946ce0f38d480741dbba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 15 Apr 2012 18:00:59 +0200 Subject: [PATCH] Fixing ChatXEditor::prune() --- .../data/chat/message/ChatMessageEditor.class.php | 5 ++--- file/lib/data/chat/room/ChatRoomEditor.class.php | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/file/lib/data/chat/message/ChatMessageEditor.class.php b/file/lib/data/chat/message/ChatMessageEditor.class.php index 8d5f1a1..53c10fd 100644 --- a/file/lib/data/chat/message/ChatMessageEditor.class.php +++ b/file/lib/data/chat/message/ChatMessageEditor.class.php @@ -24,11 +24,10 @@ class ChatMessageEditor extends \wcf\data\DatabaseObjectEditor { * @return integer Number of deleted messages. */ public static function prune($lifetime = CHAT_LOG_ARCHIVETIME) { - $baseClass = self::$baseClass; $sql = "SELECT - ".$baseClass::getDatabaseTableIndexName()." + ".static::getDatabaseTableIndexName()." FROM - ".$baseClass::getDatabaseTableName()." + ".static::getDatabaseTableName()." WHERE time < ?"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); diff --git a/file/lib/data/chat/room/ChatRoomEditor.class.php b/file/lib/data/chat/room/ChatRoomEditor.class.php index 5cc9146..8a1498a 100644 --- a/file/lib/data/chat/room/ChatRoomEditor.class.php +++ b/file/lib/data/chat/room/ChatRoomEditor.class.php @@ -41,21 +41,22 @@ public static function deleteAll(array $objectIDs = array()) { * @return integer Number of deleted rooms */ public static function prune() { - $baseClass = self::$baseClass; $sql = "SELECT - ".$baseClass::getDatabaseTableIndexName()." + ".static::getDatabaseTableIndexName()." FROM - ".$baseClass::getDatabaseTableName()." + ".static::getDatabaseTableName()." WHERE - permanent = ? - AND roomID NOT IN( + permanent = ? + AND roomID NOT IN ( SELECT fieldValue AS roomID FROM wcf".WCF_N."_user_storage WHERE packageID = ? - AND field = ?)"; + AND field = ? + AND fieldValue IS NOT NULL + )"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); $stmt->execute(array(0, \wcf\util\ChatUtil::getPackageID(), 'roomID')); $objectIDs = array();