From d9c26c86a3441900555d4bb7bd9bf6d9e4349740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 20 Oct 2020 11:40:40 +0200 Subject: [PATCH] Also expire share type email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files_sharing/lib/ExpireSharesJob.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/ExpireSharesJob.php b/apps/files_sharing/lib/ExpireSharesJob.php index 4ca3b80e34..ac86b53e41 100644 --- a/apps/files_sharing/lib/ExpireSharesJob.php +++ b/apps/files_sharing/lib/ExpireSharesJob.php @@ -24,6 +24,7 @@ namespace OCA\Files_Sharing; +use OCP\Share\IShare; use OC\BackgroundJob\TimedJob; /** @@ -51,7 +52,7 @@ class ExpireSharesJob extends TimedJob { $now = new \DateTime(); $now = $now->format('Y-m-d H:i:s'); - /* + /** * Expire file link shares only (for now) */ $qb = $connection->getQueryBuilder(); @@ -59,7 +60,10 @@ class ExpireSharesJob extends TimedJob { ->from('share') ->where( $qb->expr()->andX( - $qb->expr()->eq('share_type', $qb->expr()->literal(\OCP\Share::SHARE_TYPE_LINK)), + $qb->expr()->orX( + $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_LINK)), + $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_EMAIL)) + ), $qb->expr()->lte('expiration', $qb->expr()->literal($now)), $qb->expr()->orX( $qb->expr()->eq('item_type', $qb->expr()->literal('file')),