aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 04c72b459b4..f61b9dac58a 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -211,6 +211,8 @@ class ShareAPIController extends OCSController {
$result['share_with'] = $share->getPassword();
$result['share_with_displayname'] = $share->getPassword();
+ $result['send_password_by_talk'] = $share->getSendPasswordByTalk();
+
$result['token'] = $share->getToken();
$result['url'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $share->getToken()]);
@@ -479,10 +481,19 @@ class ShareAPIController extends OCSController {
$share->setPassword($password);
}
+
if (!empty($label)) {
$share->setLabel($label);
}
+ if ($sendPasswordByTalk === 'true') {
+ if (!$this->appManager->isEnabledForUser('spreed')) {
+ throw new OCSForbiddenException($this->l->t('Sharing %s sending the password by Nextcloud Talk failed because Nextcloud Talk is not enabled', [$path->getPath()]));
+ }
+
+ $share->setSendPasswordByTalk(true);
+ }
+
//Expire date
if ($expireDate !== '') {
try {
@@ -889,6 +900,15 @@ class ShareAPIController extends OCSController {
$share->setLabel($label);
}
+ if ($sendPasswordByTalk === 'true') {
+ if (!$this->appManager->isEnabledForUser('spreed')) {
+ throw new OCSForbiddenException($this->l->t('Sharing sending the password by Nextcloud Talk failed because Nextcloud Talk is not enabled'));
+ }
+
+ $share->setSendPasswordByTalk(true);
+ } else if ($sendPasswordByTalk !== null) {
+ $share->setSendPasswordByTalk(false);
+ }
} else {
if ($permissions !== null) {
$permissions = (int)$permissions;