Skip to content

Commit

Permalink
fix: Implement IGetDisplayNameBackend
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and blizzz committed Oct 10, 2023
1 parent 69d1ece commit 0caf43f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\Server;
use OCP\User\Backend\IGetDisplayNameBackend;
use OCP\User\Events\UserChangedEvent;
use OCP\UserInterface;

class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
class UserBackend implements IApacheBackend, UserInterface, IUserBackend, IGetDisplayNameBackend {
/** @var IConfig */
private $config;
/** @var IURLGenerator */
Expand Down Expand Up @@ -308,9 +309,9 @@ public function setDisplayName($uid, $displayName) {
*
* @param string $uid user ID of the user
* @return string display name
* @since 4.5.0
* @since 14.0.0
*/
public function getDisplayName($uid) {
public function getDisplayName($uid): string {
if ($backend = $this->getActualUserBackend($uid)) {
return $backend->getDisplayName($uid);
} else {
Expand All @@ -328,7 +329,7 @@ public function getDisplayName($uid) {
}
}

return false;
return $uid;
}

/**
Expand Down

0 comments on commit 0caf43f

Please sign in to comment.