зеркало из https://github.com/nextcloud/server.git
fix(federation): Return the used userID to allow the inviting server to react to the famous `mapUid` result
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
cee227ae99
Коммит
15a530008f
|
@ -173,15 +173,18 @@ class RequestHandlerController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace OCA\CloudFederationAPI;
|
|||
/**
|
||||
* @psalm-type CloudFederationAPIAddShare = array{
|
||||
* recipientDisplayName: string,
|
||||
* recipientUserId?: string,
|
||||
* }
|
||||
*
|
||||
* @psalm-type CloudFederationAPIError = array{
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
"properties": {
|
||||
"recipientDisplayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"recipientUserId": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче