Skip to content

Commit 486af42

Browse files
committed
Skip push notifications for banned users
See https://www.woltlab.com/community/thread/314776/
1 parent 83568c4 commit 486af42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wcfsetup/install/files/lib/system/background/job/ServiceWorkerDeliveryBackgroundJob.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ private function sendNotification(int $serviceWorkerID, int $notificationID): vo
8888
}
8989
$user = WCF::getUser();
9090
try {
91-
SessionHandler::getInstance()->changeUser(new User($notification->userID), true);
91+
$targetUser = new User($notification->userID);
92+
if ($targetUser->banned) {
93+
return;
94+
}
95+
96+
SessionHandler::getInstance()->changeUser($targetUser, true);
9297
$processedNotifications = UserNotificationHandler::getInstance()->processNotifications([$notification]);
9398
if ($processedNotifications['count'] == 0) {
9499
return;

0 commit comments

Comments
 (0)