Skip to content

Commit

Permalink
fix(federation): Fix compatibility with Nextcloud 30 when using https
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 2, 2025
1 parent c62588c commit 683cb88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Federation/CloudFederationProviderTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 683cb88

Please sign in to comment.