|
|
|
@ -851,4 +851,30 @@ class Manager extends PublicEmitter implements IUserManager {
|
|
|
|
public function getDisplayNameCache(): DisplayNameCache {
|
|
|
|
public function getDisplayNameCache(): DisplayNameCache {
|
|
|
|
return $this->displayNameCache;
|
|
|
|
return $this->displayNameCache;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Gets the list of users sorted by lastLogin, from most recent to least recent
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param int $offset from which offset to fetch
|
|
|
|
|
|
|
|
* @return \Iterator<IUser> list of user IDs
|
|
|
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getSeenUsers(int $offset = 0): \Iterator {
|
|
|
|
|
|
|
|
$limit = 1000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
|
|
|
$userIds = $this->getSeenUserIds($limit, $offset);
|
|
|
|
|
|
|
|
$offset += $limit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($userIds as $userId) {
|
|
|
|
|
|
|
|
foreach ($this->backends as $backend) {
|
|
|
|
|
|
|
|
if ($backend->userExists($userId)) {
|
|
|
|
|
|
|
|
$user = $this->getUserObject($userId, $backend, false);
|
|
|
|
|
|
|
|
yield $user;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} while (count($userIds) === $limit);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|