From d821ce73c4f42c7802bca393a87e0a45dee0ff6e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 5 Jan 2020 22:38:19 +0100 Subject: [PATCH] Incorrect deduction of activity points for revoked reactions --- .../files/lib/system/reaction/ReactionHandler.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); -- 2.20.1