mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
ChatUtil::writeUserData now accepts the user-object as the second parameter.
This commit is contained in:
parent
2e2edec54f
commit
3eaf35c9c1
@ -223,14 +223,16 @@ public static function timeModifier($time) {
|
||||
/**
|
||||
* Writes user data
|
||||
*
|
||||
* @param \wcf\data\user\User $user
|
||||
* @param array $data
|
||||
*/
|
||||
public static function writeUserData(array $data) {
|
||||
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(WCF::getUser()->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID);
|
||||
$ush->update($user->userID, $key, (isset(static::$serialize[$key])) ? serialize($value) : $value, $packageID);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user