1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Fixing ChatXEditor::prune()

This commit is contained in:
Tim Düsterhus 2012-04-15 18:00:59 +02:00
parent 0a0c3165e7
commit 3248b14097
2 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -41,11 +41,10 @@ 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 (
@ -55,7 +54,9 @@ public static function prune() {
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();