From c6e7920afa001470ad276d49a6ad1758836559bd Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Mon, 17 Jan 2022 11:06:07 +0100 Subject: [PATCH] Add `$userID` parameter to `ModerationQueueManager::setAssignment` --- .../moderation/queue/ModerationQueueManager.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php index 5432f9f558..954b0a9e41 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php @@ -346,8 +346,12 @@ class ModerationQueueManager extends SingletonFactory * * @param bool[] $assignments */ - public function setAssignment(array $assignments) + public function setAssignment(array $assignments, ?int $userID = null) { + if ($userID === null) { + $userID = WCF::getUser()->userID; + } + $sql = "INSERT IGNORE INTO wcf" . WCF_N . "_moderation_queue_to_user (queueID, userID, isAffected) VALUES (?, ?, ?)"; @@ -357,7 +361,7 @@ class ModerationQueueManager extends SingletonFactory foreach ($assignments as $queueID => $isAffected) { $statement->execute([ $queueID, - WCF::getUser()->userID, + $userID, $isAffected ? 1 : 0, ]); } -- 2.20.1