diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-05 14:27:49 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-07-12 20:14:30 +0200 |
commit | 75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2 (patch) | |
tree | 76848e6508759a1045883e27bbd64ba669660747 /lib/private/Share20 | |
parent | c253112cf77411ee374ea29a9566cdd28d3e544d (diff) | |
download | nextcloud-server-75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2.tar.gz nextcloud-server-75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2.zip |
feat(files_sharing): allow mixed values in share attributes and allow storing email arrays
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 8 | ||||
-rw-r--r-- | lib/private/Share20/ShareAttributes.php | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 875c2a85188..d1d818222e2 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -1382,7 +1382,7 @@ class DefaultShareProvider implements IShareProviderWithNotification { } } - public function sendMailNotification(IShare $share): true { + public function sendMailNotification(IShare $share): bool { try { // Check user $user = $this->userManager->get($share->getSharedWith()); @@ -1616,7 +1616,7 @@ class DefaultShareProvider implements IShareProviderWithNotification { * * @return IShare the modified share */ - private function updateShareAttributes(IShare $share, ?string $data): IShare { + protected function updateShareAttributes(IShare $share, ?string $data): IShare { if ($data !== null && $data !== '') { $attributes = new ShareAttributes(); $compressedAttributes = \json_decode($data, true); @@ -1639,7 +1639,7 @@ class DefaultShareProvider implements IShareProviderWithNotification { /** * Format IAttributes to database format (JSON string) */ - private function formatShareAttributes(?IAttributes $attributes): ?string { + protected function formatShareAttributes(?IAttributes $attributes): ?string { if ($attributes === null || empty($attributes->toArray())) { return null; } @@ -1649,7 +1649,7 @@ class DefaultShareProvider implements IShareProviderWithNotification { $compressedAttributes[] = [ 0 => $attribute['scope'], 1 => $attribute['key'], - 2 => $attribute['enabled'] + 2 => $attribute['value'] ]; } return \json_encode($compressedAttributes); diff --git a/lib/private/Share20/ShareAttributes.php b/lib/private/Share20/ShareAttributes.php index abbbd36759b..4011278bb39 100644 --- a/lib/private/Share20/ShareAttributes.php +++ b/lib/private/Share20/ShareAttributes.php @@ -20,11 +20,11 @@ class ShareAttributes implements IAttributes { /** * @inheritdoc */ - public function setAttribute($scope, $key, $enabled) { + public function setAttribute($scope, $key, $value) { if (!\array_key_exists($scope, $this->attributes)) { $this->attributes[$scope] = []; } - $this->attributes[$scope][$key] = $enabled; + $this->attributes[$scope][$key] = $value; return $this; } @@ -45,11 +45,11 @@ class ShareAttributes implements IAttributes { public function toArray() { $result = []; foreach ($this->attributes as $scope => $keys) { - foreach ($keys as $key => $enabled) { + foreach ($keys as $key => $value) { $result[] = [ "scope" => $scope, "key" => $key, - "enabled" => $enabled + "value" => $value ]; } } |