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:
parent
0a0c3165e7
commit
3248b14097
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user