From 09d910088ff14414289bc37c897cd9546f5534e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 5 Sep 2024 12:27:30 +0200 Subject: [PATCH] fix: Fix display name of new users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/Listeners/AccountUpdated.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Listeners/AccountUpdated.php b/lib/Listeners/AccountUpdated.php index d1ffccc1e..c74ef7162 100644 --- a/lib/Listeners/AccountUpdated.php +++ b/lib/Listeners/AccountUpdated.php @@ -11,6 +11,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; @@ -30,7 +31,8 @@ public function __construct( private CircleService $circleService, private FederatedEventService $federatedEventService, private FederatedUserService $federatedUserService, - private LoggerInterface $logger + private LoggerInterface $logger, + private MemberRequest $memberRequest ) { } @@ -47,6 +49,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);