use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\system\event\EventHandler;
-use wcf\system\user\storage\UserStorageHandler;
use wcf\system\WCF;
use wcf\util\StringUtil;
$objects = $this->objects;
$this->indexToObject = $this->objects = [];
- UserStorageHandler::getInstance()->loadStorage($this->objectIDs);
-
foreach ($objects as $object) {
$object = new UserOnline(new User(null, null, $object));
if (!$object->userID || self::isVisibleUser($object)) {
}
}
- UserStorageHandler::getInstance()->loadStorage($userIDs);
-
foreach ($users as $user) {
if ($user->canViewOnlineStatus && !self::isVisibleUser($user)) {
$this->stats['invisible']++;
'userOnline' => $userOnline,
];
- if ($userOnline->getPermission('user.profile.canHideOnlineStatus')) {
- switch ($userOnline->canViewOnlineStatus) {
- case UserProfile::ACCESS_EVERYONE:
- $data['result'] = true;
- break;
-
- case UserProfile::ACCESS_REGISTERED:
- if (WCF::getUser()->userID) $data['result'] = true;
- break;
-
- case UserProfile::ACCESS_FOLLOWING:
- /** @noinspection PhpUndefinedMethodInspection */
- if (WCF::getUserProfileHandler()->isFollower($userOnline->userID)) $data['result'] = true;
- break;
- }
- }
- else {
- $data['result'] = true;
+ switch ($userOnline->canViewOnlineStatus) {
+ case UserProfile::ACCESS_EVERYONE:
+ $data['result'] = true;
+ break;
+
+ case UserProfile::ACCESS_REGISTERED:
+ if (WCF::getUser()->userID) $data['result'] = true;
+ break;
+
+ case UserProfile::ACCESS_FOLLOWING:
+ /** @noinspection PhpUndefinedMethodInspection */
+ if (WCF::getUserProfileHandler()->isFollower($userOnline->userID)) $data['result'] = true;
+ break;
}
EventHandler::getInstance()->fireAction(get_called_class(), 'isVisibleUser', $data);