From: Alexander Ebert Date: Sun, 5 Jan 2020 21:38:19 +0000 (+0100) Subject: Incorrect deduction of activity points for revoked reactions X-Git-Tag: 5.2.1~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d821ce73c4f42c7802bca393a87e0a45dee0ff6e;p=GitHub%2FWoltLab%2FWCF.git Incorrect deduction of activity points for revoked reactions --- diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index 7d5ad8ef91..ee8b4b57ba 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -652,9 +652,12 @@ class ReactionHandler extends SingletonFactory { $likeList->readObjects(); if (count($likeList)) { - $likeData = []; + $activityPoints = $likeData = []; foreach ($likeList as $like) { $likeData[$like->likeID] = $like->userID; + + if (!isset($activityPoints[$like->userID])) $activityPoints[$like->userID] = 0; + $activityPoints[$like->userID]++; } // delete like notifications @@ -668,7 +671,7 @@ class ReactionHandler extends SingletonFactory { } // revoke activity points - UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $likeData); + UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $activityPoints); // delete likes (new ReactionAction(array_keys($likeData), 'delete'))->executeAction();