aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-07-05 14:27:49 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-07-12 20:14:30 +0200
commit75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2 (patch)
tree76848e6508759a1045883e27bbd64ba669660747 /lib/private/Share20
parentc253112cf77411ee374ea29a9566cdd28d3e544d (diff)
downloadnextcloud-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.php8
-rw-r--r--lib/private/Share20/ShareAttributes.php8
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
];
}
}