aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-09-03 17:24:02 +0200
committerGitHub <noreply@github.com>2024-09-03 17:24:02 +0200
commitf9fcc5b17025e34c42ad53fa4401e8b79064c75f (patch)
treea1df8222b9ec2bdac76761b0c13d8bf54ef750c9 /lib
parentf5f9691f387473982bff7d9788fe3350979e7cbc (diff)
parent2685501231821be2f7ca72568bedd5571fe0eef2 (diff)
downloadnextcloud-server-f9fcc5b17025e34c42ad53fa4401e8b79064c75f.tar.gz
nextcloud-server-f9fcc5b17025e34c42ad53fa4401e8b79064c75f.zip
Merge pull request #47412 from Luka-sama/feat/shares-reminder
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php6
-rw-r--r--lib/private/Share20/Share.php10
-rw-r--r--lib/public/Share/IShare.php16
3 files changed, 31 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 9268d575c85..3ea429dfe3d 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -97,6 +97,8 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
if ($expirationDate !== null) {
$qb->setValue('expiration', $qb->createNamedParameter($expirationDate, 'datetime'));
}
+
+ $qb->setValue('reminder_sent', $qb->createNamedParameter($share->getReminderSent(), IQueryBuilder::PARAM_BOOL));
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
//Set the GID of the group we share with
$qb->setValue('share_with', $qb->createNamedParameter($share->getSharedWith()));
@@ -223,6 +225,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
->set('accepted', $qb->createNamedParameter($share->getStatus()))
+ ->set('reminder_sent', $qb->createNamedParameter($share->getReminderSent(), IQueryBuilder::PARAM_BOOL))
->execute();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
$qb = $this->dbConn->getQueryBuilder();
@@ -1006,7 +1009,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
}
/**
- * Create a share object from an database row
+ * Create a share object from a database row
*
* @param mixed[] $data
* @return \OCP\Share\IShare
@@ -1068,6 +1071,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$share->setProviderId($this->identifier());
$share->setHideDownload((int)$data['hide_download'] === 1);
+ $share->setReminderSent((bool)$data['reminder_sent']);
return $share;
}
diff --git a/lib/private/Share20/Share.php b/lib/private/Share20/Share.php
index b01d05ca4b9..1c0b21b8038 100644
--- a/lib/private/Share20/Share.php
+++ b/lib/private/Share20/Share.php
@@ -72,6 +72,7 @@ class Share implements IShare {
private $nodeCacheEntry;
/** @var bool */
private $hideDownload = false;
+ private bool $reminderSent = false;
private bool $noExpirationDate = false;
@@ -613,4 +614,13 @@ class Share implements IShare {
public function getHideDownload(): bool {
return $this->hideDownload;
}
+
+ public function setReminderSent(bool $reminderSent): IShare {
+ $this->reminderSent = $reminderSent;
+ return $this;
+ }
+
+ public function getReminderSent(): bool {
+ return $this->reminderSent;
+ }
}
diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php
index fe5e7eb47dd..c2843c078e3 100644
--- a/lib/public/Share/IShare.php
+++ b/lib/public/Share/IShare.php
@@ -617,4 +617,20 @@ interface IShare {
* @since 15.0.0
*/
public function getHideDownload(): bool;
+
+ /**
+ * Sets a flag that stores whether a reminder via email has been sent
+ *
+ * @return self The modified object
+ * @since 31.0.0
+ */
+ public function setReminderSent(bool $reminderSent): IShare;
+
+ /**
+ * Gets a flag that stores whether a reminder via email has been sent
+ *
+ * @return bool
+ * @since 31.0.0
+ */
+ public function getReminderSent(): bool;
}