Use `UserProfile::ACCESS_EVERYONE` constant
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 Dec 2024 13:36:21 +0000 (14:36 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 23 Dec 2024 13:36:21 +0000 (14:36 +0100)
wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php

index 537d52e90cf2171a35457783be5bfcfbde6389a0..3d8f9be35ed4a218940a33545f4f46e34a2e0ced 100644 (file)
@@ -349,7 +349,7 @@ final class UserRebuildDataWorker extends AbstractLinearRebuildDataWorker
     private function updateUserOnlineStatus(array $users): void
     {
         foreach ($users as $user) {
-            if (!$user->canViewOnlineStatus) {
+            if ($user->canViewOnlineStatus == UserProfile::ACCESS_EVERYONE) {
                 continue;
             }
             $userProfile = new UserProfile($user->getDecoratedObject());
@@ -358,7 +358,7 @@ final class UserRebuildDataWorker extends AbstractLinearRebuildDataWorker
             }
 
             $user->updateUserOptions([
-                User::getUserOptionID('canViewOnlineStatus') => 0,
+                User::getUserOptionID('canViewOnlineStatus') => UserProfile::ACCESS_EVERYONE,
             ]);
         }
     }