diff options
author | Joas Schilling <coding@schilljs.com> | 2024-03-13 16:56:03 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-03-14 09:47:19 +0100 |
commit | 6d5de533a6f00e950c4b5ce202c5587e59ca9ba0 (patch) | |
tree | 4777c346472dff6c3cd0d555916a69a59926cd21 /lib/Federation | |
parent | 2e947ea83cfbe462043af920da239903904bcec1 (diff) |
fix(federation): Send the display name when accepting the invite
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Federation')
-rw-r--r-- | lib/Federation/BackendNotifier.php | 2 | ||||
-rw-r--r-- | lib/Federation/CloudFederationProviderTalk.php | 5 | ||||
-rw-r--r-- | lib/Federation/FederationManager.php | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/Federation/BackendNotifier.php b/lib/Federation/BackendNotifier.php index 15cfb0ac3..cb2102afe 100644 --- a/lib/Federation/BackendNotifier.php +++ b/lib/Federation/BackendNotifier.php @@ -179,6 +179,7 @@ class BackendNotifier { int $remoteAttendeeId, #[SensitiveParameter] string $accessToken, + string $displayName, ): bool { $remote = $this->prepareRemoteUrl($remoteServerUrl); @@ -191,6 +192,7 @@ class BackendNotifier { 'remoteServerUrl' => $this->getServerRemoteUrl(), 'sharedSecret' => $accessToken, 'message' => 'Recipient accepted the share', + 'displayName' => $displayName, ] ); diff --git a/lib/Federation/CloudFederationProviderTalk.php b/lib/Federation/CloudFederationProviderTalk.php index 4615585af..8b3340388 100644 --- a/lib/Federation/CloudFederationProviderTalk.php +++ b/lib/Federation/CloudFederationProviderTalk.php @@ -213,6 +213,11 @@ class CloudFederationProviderTalk implements ICloudFederationProvider { private function shareAccepted(int $id, array $notification): array { $attendee = $this->getLocalAttendeeAndValidate($id, $notification['sharedSecret']); + if (!empty($notification['displayName'])) { + $attendee->setDisplayName($notification['displayName']); + $this->attendeeMapper->update($attendee); + } + $this->session->set('talk-overwrite-actor-type', $attendee->getActorType()); $this->session->set('talk-overwrite-actor-id', $attendee->getActorId()); $this->session->set('talk-overwrite-actor-displayname', $attendee->getDisplayName()); diff --git a/lib/Federation/FederationManager.php b/lib/Federation/FederationManager.php index b5bd2ea25..88b56f4ca 100644 --- a/lib/Federation/FederationManager.php +++ b/lib/Federation/FederationManager.php @@ -134,7 +134,7 @@ class FederationManager { // Add user to the room $room = $this->manager->getRoomById($invitation->getLocalRoomId()); if ( - !$this->backendNotifier->sendShareAccepted($invitation->getRemoteServerUrl(), $invitation->getRemoteAttendeeId(), $invitation->getAccessToken()) + !$this->backendNotifier->sendShareAccepted($invitation->getRemoteServerUrl(), $invitation->getRemoteAttendeeId(), $invitation->getAccessToken(), $user->getDisplayName()) ) { throw new CannotReachRemoteException(); } |