Skip to content

Commit

Permalink
fix: Fix display name of new users
Browse files Browse the repository at this point in the history
Although the display name of users is updated in a circle when it is
changed in the user settings, the new display name was not shown if the
user was then added to a circle due to a missing update of the member
and, therefore, the cached name.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Sep 10, 2024
1 parent c416664 commit 5681192
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Listeners/AccountUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use Exception;
use OCA\Circles\Db\CircleRequest;
use OCA\Circles\Db\MemberRequest;
use OCA\Circles\FederatedItems\MemberDisplayName;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Probes\CircleProbe;
Expand All @@ -49,7 +50,8 @@ public function __construct(
private CircleService $circleService,
private FederatedEventService $federatedEventService,
private FederatedUserService $federatedUserService,
private LoggerInterface $logger
private LoggerInterface $logger,
private MemberRequest $memberRequest
) {
}

Expand All @@ -66,6 +68,7 @@ public function handle(Event $event): void {
$user = $event->getUser();
$federatedUser = $this->federatedUserService->getLocalFederatedUser($user->getUID());

$this->memberRequest->updateDisplayName($federatedUser->getSingleId(), $user->getDisplayName());
$this->circleRequest->updateDisplayName($federatedUser->getSingleId(), $user->getDisplayName());
$this->federatedUserService->setCurrentUser($federatedUser);

Expand Down

0 comments on commit 5681192

Please sign in to comment.