Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,13 @@ protected function formatShare(\OCP\Share\IShare $share, Node $recipientNode = n
$result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith();
} else if ($share->getShareType() === Share::SHARE_TYPE_LINK) {

// "share_with" and "share_with_displayname" for passwords of link
// shares was deprecated in Nextcloud 15, use "password" instead.
$result['share_with'] = $share->getPassword();
$result['share_with_displayname'] = $share->getPassword();

$result['password'] = $share->getPassword();

$result['send_password_by_talk'] = $share->getSendPasswordByTalk();

$result['token'] = $share->getToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ public function dataGetShare() {
$expected = [
'id' => 101,
'share_type' => \OCP\Share::SHARE_TYPE_LINK,
'password' => 'password',
'share_with' => 'password',
'share_with_displayname' => 'password',
'send_password_by_talk' => false,
Expand Down Expand Up @@ -2687,6 +2688,7 @@ public function dataFormatShare() {
'file_source' => 3,
'file_parent' => 1,
'file_target' => 'myTarget',
'password' => 'mypassword',
'share_with' => 'mypassword',
'share_with_displayname' => 'mypassword',
'send_password_by_talk' => false,
Expand Down Expand Up @@ -2736,6 +2738,7 @@ public function dataFormatShare() {
'file_source' => 3,
'file_parent' => 1,
'file_target' => 'myTarget',
'password' => 'mypassword',
'share_with' => 'mypassword',
'share_with_displayname' => 'mypassword',
'send_password_by_talk' => true,
Expand Down