aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-20 13:58:01 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-03-22 06:34:09 +0100
commit100d5d9a4707dd7f5f6572d69dd55cb3d62b955f (patch)
tree200cea3d7d942c48d308497e1e5abf78e7f38f59 /apps/sharebymail/lib
parentae19cb168f9d3c45964ed50d868258798edb3f55 (diff)
downloadnextcloud-server-100d5d9a4707dd7f5f6572d69dd55cb3d62b955f.tar.gz
nextcloud-server-100d5d9a4707dd7f5f6572d69dd55cb3d62b955f.zip
Add labels to mail shares
Now the email is shown on a second line if a label is set. Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 2484ccdd720..e1585955c62 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -322,6 +322,7 @@ class ShareByMailProvider implements IShareProvider {
$share->getPassword(),
$share->getSendPasswordByTalk(),
$share->getHideDownload(),
+ $share->getLabel(),
$share->getExpirationDate()
);
@@ -659,10 +660,11 @@ class ShareByMailProvider implements IShareProvider {
* @param string $password
* @param bool $sendPasswordByTalk
* @param bool $hideDownload
+ * @param string $label
* @param \DateTime|null $expirationTime
* @return int
*/
- protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $expirationTime) {
+ protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $label, $expirationTime) {
$qb = $this->dbConnection->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL))
@@ -677,7 +679,8 @@ class ShareByMailProvider implements IShareProvider {
->setValue('password', $qb->createNamedParameter($password))
->setValue('password_by_talk', $qb->createNamedParameter($sendPasswordByTalk, IQueryBuilder::PARAM_BOOL))
->setValue('stime', $qb->createNamedParameter(time()))
- ->setValue('hide_download', $qb->createNamedParameter((int)$hideDownload, IQueryBuilder::PARAM_INT));
+ ->setValue('hide_download', $qb->createNamedParameter((int)$hideDownload, IQueryBuilder::PARAM_INT))
+ ->setValue('label', $qb->createNamedParameter($label));
if ($expirationTime !== null) {
$qb->setValue('expiration', $qb->createNamedParameter($expirationTime, IQueryBuilder::PARAM_DATE));
@@ -720,6 +723,7 @@ class ShareByMailProvider implements IShareProvider {
->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy()))
->set('password', $qb->createNamedParameter($share->getPassword()))
+ ->set('label', $qb->createNamedParameter($share->getLabel()))
->set('password_by_talk', $qb->createNamedParameter($share->getSendPasswordByTalk(), IQueryBuilder::PARAM_BOOL))
->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
@@ -982,6 +986,7 @@ class ShareByMailProvider implements IShareProvider {
$share->setShareTime($shareTime);
$share->setSharedWith($data['share_with']);
$share->setPassword($data['password']);
+ $share->setLabel($data['label']);
$share->setSendPasswordByTalk((bool)$data['password_by_talk']);
$share->setHideDownload((bool)$data['hide_download']);