From 41e0fdb818a3d123efd5e21dcd5438bd89c1ca28 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 af8f09ee9..2a2b930db 100644 --- a/lib/Listeners/AccountUpdated.php +++ b/lib/Listeners/AccountUpdated.php @@ -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; @@ -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 ) { } @@ -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);