From 683cb8871e88898a199e308e126e05409b0850fb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Jan 2025 08:30:18 +0100 Subject: [PATCH] fix(federation): Fix compatibility with Nextcloud 30 when using https Signed-off-by: Joas Schilling --- lib/Federation/CloudFederationProviderTalk.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Federation/CloudFederationProviderTalk.php b/lib/Federation/CloudFederationProviderTalk.php index c0e5c7871c8..335c719cc8b 100644 --- a/lib/Federation/CloudFederationProviderTalk.php +++ b/lib/Federation/CloudFederationProviderTalk.php @@ -642,15 +642,20 @@ public function getFederationIdFromSharedSecret( string $sharedSecret, array $payload, ): string { + $remoteServerUrl = $payload['remoteServerUrl']; + if (str_starts_with($remoteServerUrl, 'https://')) { + $remoteServerUrl = substr($remoteServerUrl, strlen('https://')); + } + try { - $invite = $this->invitationMapper->getByRemoteServerAndAccessToken($payload['remoteServerUrl'], $sharedSecret); + $invite = $this->invitationMapper->getByRemoteServerAndAccessToken($remoteServerUrl, $sharedSecret); return $invite->getInviterCloudId(); } catch (DoesNotExistException) { } $attendees = $this->attendeeMapper->getByAccessToken($sharedSecret); foreach ($attendees as $attendee) { - if (str_ends_with($attendee->getActorId(), $payload['remoteServerUrl'])) { + if (str_ends_with($attendee->getActorId(), '@' . $remoteServerUrl)) { return $attendee->getActorId(); } }