Skip to content

Commit

Permalink
fix: Fix display name of new users
Browse files Browse the repository at this point in the history
When a user is created the display name was cached based on the account
data. However, the account data does not provide a display name, so when
the user was added to a circle only the user id was shown. Now the
display name is got from the "IUser" API instead.

"SyncService::syncNextcloudUser" just calls
"FederatedUserService::getLocalFederatedUser" with a parameter that
causes the display name to be got from the account data, so the call to
"syncNextcloudUser" is just replaced with a direct call to
"getLocalFederatedUser" with the default parameters, which cause the
display name to be got from the "IUser" API.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Sep 5, 2024
1 parent 37003d8 commit 38fa786
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Listeners/UserCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace OCA\Circles\Listeners;

use Exception;
use OCA\Circles\Service\SyncService;
use OCA\Circles\Service\FederatedUserService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\User\Events\UserCreatedEvent;
Expand All @@ -29,7 +29,7 @@ class UserCreated implements IEventListener {
* @param SyncService $syncService
*/
public function __construct(SyncService $syncService) {
$this->syncService = $syncService;
$this->federatedUserService = $federatedUserService;
}


Expand All @@ -44,7 +44,7 @@ public function handle(Event $event): void {
$user = $event->getUser();

try {
$this->syncService->syncNextcloudUser($user->getUID());
$this->federatedUserService->getLocalFederatedUser($user->getUID());
} catch (Exception $e) {
}
}
Expand Down

0 comments on commit 38fa786

Please sign in to comment.