);
}
- $user = $this->userManager->get($shareWith);
- $recipientDisplayName = '';
- if ($user) {
- $recipientDisplayName = $user->getDisplayName();
+ $responseData = ['recipientDisplayName' => ''];
+ if ($shareType === 'user') {
+ $user = $this->userManager->get($shareWith);
+ if ($user) {
+ $responseData = [
+ 'recipientDisplayName' => $user->getDisplayName(),
+ 'recipientUserId' => $user->getUID(),
+ ];
+ }
}
- return new JSONResponse(
- ['recipientDisplayName' => $recipientDisplayName],
- Http::STATUS_CREATED);
+ return new JSONResponse($responseData, Http::STATUS_CREATED);
}
/**
/**
* @psalm-type CloudFederationAPIAddShare = array{
* recipientDisplayName: string,
+ * recipientUserId?: string,
* }
*
* @psalm-type CloudFederationAPIError = array{