diff options
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/LazyUser.php | 2 | ||||
-rw-r--r-- | lib/private/User/Manager.php | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php index c36ff86eff4..5472cf6f2b4 100644 --- a/lib/private/User/LazyUser.php +++ b/lib/private/User/LazyUser.php @@ -65,7 +65,7 @@ class LazyUser implements IUser { return $this->displayName; } - return $this->userManager->getDisplayName($this->uid); + return $this->userManager->getDisplayName($this->uid) ?? $this->uid; } public function setDisplayName($displayName) { diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index c3275934a5a..dcf9bbab2f3 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -303,12 +303,11 @@ class Manager extends PublicEmitter implements IUserManager { */ public function search($pattern, $limit = null, $offset = null) { $users = []; - $displayNameCache = \OCP\Server::get(DisplayNameCache::class); foreach ($this->backends as $backend) { $backendUsers = $backend->getUsers($pattern, $limit, $offset); if (is_array($backendUsers)) { foreach ($backendUsers as $uid) { - $users[$uid] = new LazyUser($uid, $displayNameCache, $this, null, $backend); + $users[$uid] = new LazyUser($uid, $this, null, $backend); } } } @@ -329,12 +328,11 @@ class Manager extends PublicEmitter implements IUserManager { */ public function searchDisplayName($pattern, $limit = null, $offset = null) { $users = []; - $displayNameCache = \OCP\Server::get(DisplayNameCache::class); foreach ($this->backends as $backend) { $backendUsers = $backend->getDisplayNames($pattern, $limit, $offset); if (is_array($backendUsers)) { foreach ($backendUsers as $uid => $displayName) { - $users[] = new LazyUser($uid, $displayNameCache, $this, $displayName, $backend); + $users[] = new LazyUser($uid, $this, $displayName, $backend); } } } |