diff --git a/file/lib/acp/form/ChatRoomEditForm.class.php b/file/lib/acp/form/ChatRoomEditForm.class.php index 7081d4d..3f4fdad 100644 --- a/file/lib/acp/form/ChatRoomEditForm.class.php +++ b/file/lib/acp/form/ChatRoomEditForm.class.php @@ -63,7 +63,7 @@ public function save() { $this->title = 'wcf.chat.room.title'.$this->roomObj->roomID; if (I18nHandler::getInstance()->isPlainValue('title')) { - I18nHandler::getInstance()->remove($this->title, \wcf\util\ChatUtil::getPackageID()); + I18nHandler::getInstance()->remove($this->title); $this->title = I18nHandler::getInstance()->getValue('title'); } else { @@ -72,7 +72,7 @@ public function save() { $this->topic = 'wcf.chat.room.topic'.$this->roomObj->roomID; if (I18nHandler::getInstance()->isPlainValue('topic')) { - I18nHandler::getInstance()->remove($this->topic, \wcf\util\ChatUtil::getPackageID()); + I18nHandler::getInstance()->remove($this->topic); $this->topic = I18nHandler::getInstance()->getValue('topic'); } else { diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index c26942a..ef189ef 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -110,10 +110,9 @@ public function countUsers() { wcf".WCF_N."_user_storage WHERE field = ? - AND packageID = ? AND fieldValue = ?"; $stmt = WCF::getDB()->prepareStatement($sql); - $stmt->execute(array('roomID', \wcf\util\ChatUtil::getPackageID(), $this->roomID)); + $stmt->execute(array('roomID', $this->roomID)); return $stmt->fetchColumn(); } @@ -158,18 +157,15 @@ public function getTitle() { * @return array<\wcf\data\user\User> */ public function getUsers() { - $packageID = \wcf\util\ChatUtil::getPackageID(); - $sql = "SELECT userID FROM wcf".WCF_N."_user_storage WHERE field = ? - AND packageID = ? AND fieldValue = ?"; $stmt = WCF::getDB()->prepareStatement($sql); - $stmt->execute(array('roomID', $packageID, $this->roomID)); + $stmt->execute(array('roomID', $this->roomID)); $userIDs = array(); while ($userIDs[] = $stmt->fetchColumn()); @@ -184,15 +180,14 @@ public function getUsers() { wcf".WCF_N."_user_storage st ON ( u.userID = st.userID - AND st.field = ? - AND st.packageID = ? + AND st.field = ? ) WHERE u.userID IN (".rtrim(str_repeat('?,', count($userIDs)), ',').") ORDER BY u.username ASC"; $stmt = WCF::getDB()->prepareStatement($sql); - array_unshift($userIDs, 'away', $packageID); + array_unshift($userIDs, 'away'); $stmt->execute($userIDs); return $stmt->fetchObjects('\wcf\data\user\User'); diff --git a/file/lib/data/chat/room/ChatRoomAction.class.php b/file/lib/data/chat/room/ChatRoomAction.class.php index 6e8c826..0e83779 100644 --- a/file/lib/data/chat/room/ChatRoomAction.class.php +++ b/file/lib/data/chat/room/ChatRoomAction.class.php @@ -65,12 +65,11 @@ public function prune() { FROM wcf".WCF_N."_user_storage WHERE - packageID = ? AND field = ? AND fieldValue IS NOT NULL )"; $stmt = \wcf\system\WCF::getDB()->prepareStatement($sql); - $stmt->execute(array(0, \wcf\util\ChatUtil::getPackageID(), 'roomID')); + $stmt->execute(array(0, 'roomID')); $objectIDs = array(); while ($objectIDs[] = $stmt->fetchColumn()); diff --git a/file/lib/data/chat/room/ChatRoomEditor.class.php b/file/lib/data/chat/room/ChatRoomEditor.class.php index 6c856b4..2dc5c4c 100644 --- a/file/lib/data/chat/room/ChatRoomEditor.class.php +++ b/file/lib/data/chat/room/ChatRoomEditor.class.php @@ -22,12 +22,10 @@ class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor implements \wcf\data * @see \wcf\data\DatabaseObjectEditor::deleteAll() */ public static function deleteAll(array $objectIDs = array()) { - $packageID = \wcf\util\ChatUtil::getPackageID(); - WCF::getDB()->beginTransaction(); foreach ($objectIDs as $objectID) { - \wcf\system\language\I18nHandler::getInstance()->remove('wcf.chat.room.title'.$objectID, $packageID); - \wcf\system\language\I18nHandler::getInstance()->remove('wcf.chat.room.topic'.$objectID, $packageID); + \wcf\system\language\I18nHandler::getInstance()->remove('wcf.chat.room.title'.$objectID); + \wcf\system\language\I18nHandler::getInstance()->remove('wcf.chat.room.topic'.$objectID); } $sql = "SELECT diff --git a/file/lib/data/chat/suspension/ChatSuspensionEditor.class.php b/file/lib/data/chat/suspension/ChatSuspensionEditor.class.php index d254863..382d8e2 100644 --- a/file/lib/data/chat/suspension/ChatSuspensionEditor.class.php +++ b/file/lib/data/chat/suspension/ChatSuspensionEditor.class.php @@ -21,9 +21,8 @@ class ChatSuspensionEditor extends \wcf\data\DatabaseObjectEditor implements \wc * Clears the suspension cache. */ public static function resetCache() { - $packageID = \wcf\util\ChatUtil::getPackageID(); $ush = \wcf\system\user\storage\UserStorageHandler::getInstance(); - $ush->resetAll('suspensions', $packageID); + $ush->resetAll('suspensions'); } } diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index 5b1224e..59a71ea 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -50,7 +50,6 @@ final class ChatUtil { * @return array */ public static function getDiedUsers() { - $packageID = self::getPackageID(); if (self::nodePushRunning()) { $time = TIME_NOW - 120; } @@ -66,17 +65,15 @@ public static function getDiedUsers() { wcf".WCF_N."_user_storage a ON a.userID = r.userID AND a.field = ? - AND a.packageID = ? WHERE r.field = ? - AND r.packageID = ? AND r.fieldValue IS NOT NULL AND ( a.fieldValue < ? OR a.fieldValue IS NULL )"; $stmt = WCF::getDB()->prepareStatement($sql); - $stmt->execute(array('lastActivity', $packageID, 'roomID', $packageID, $time - 30)); + $stmt->execute(array('lastActivity', 'roomID', $time - 30)); $users = array(); while ($users[] = $stmt->fetchArray()); @@ -152,11 +149,10 @@ public static function nodePushRunning() { public static function readUserData($field, \wcf\data\user\User $user = null) { if ($user === null) $user = WCF::getUser(); $ush = UserStorageHandler::getInstance(); - $packageID = self::getPackageID(); // load storage - $ush->loadStorage(array($user->userID), $packageID); - $data = $ush->getStorage(array($user->userID), $field, $packageID); + $ush->loadStorage(array($user->userID)); + $data = $ush->getStorage(array($user->userID), $field); if ($data[$user->userID] === null) { switch ($field) { @@ -254,10 +250,9 @@ public static function timeModifier($time) { public static function writeUserData(array $data, \wcf\data\user\User $user = null) { if ($user === null) $user = WCF::getUser(); $ush = UserStorageHandler::getInstance(); - $packageID = self::getPackageID(); - + foreach ($data as $key => $value) { - $ush->update($user->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID); + $ush->update($user->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value); } }