diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 4 | ||||
-rw-r--r-- | lib/private/Share20/Manager.php | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index a6a8bdb9698..ec0f25cbae5 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -202,6 +202,10 @@ class DefaultShareProvider implements IShareProvider { // Set the file target $qb->setValue('file_target', $qb->createNamedParameter($share->getTarget())); + if ($share->getNote() !== '') { + $qb->setValue('note', $qb->createNamedParameter($share->getNote())); + } + // Set the time this share was created $qb->setValue('stime', $qb->createNamedParameter(time())); diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 1891e3a1283..2aa4d099024 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -852,7 +852,8 @@ class Manager implements IManager { $this->urlGenerator->linkToRouteAbsolute('files_sharing.Accept.accept', ['shareId' => $share->getFullId()]), $share->getSharedBy(), $emailAddress, - $share->getExpirationDate() + $share->getExpirationDate(), + $share->getNote() ); $this->logger->debug('Sent share notification to ' . $emailAddress . ' for share with ID ' . $share->getId(), ['app' => 'share']); } else { @@ -886,7 +887,8 @@ class Manager implements IManager { $link, $initiator, $shareWith, - \DateTime $expiration = null) { + \DateTime $expiration = null, + $note = '') { $initiatorUser = $this->userManager->get($initiator); $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; @@ -905,6 +907,10 @@ class Manager implements IManager { $emailTemplate->addHeading($l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false); $text = $l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]); + if ($note !== '') { + $emailTemplate->addBodyText(htmlspecialchars($note), $note); + } + $emailTemplate->addBodyText( htmlspecialchars($text . ' ' . $l->t('Click the button below to open it.')), $text |