Skip to content

Commit cb10700

Browse files
committed
Also expire share type email
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent e737d67 commit cb10700

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/files_sharing/lib/ExpireSharesJob.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace OCA\Files_Sharing;
2525

26+
use OCP\Share\IShare;
2627
use OC\BackgroundJob\TimedJob;
2728

2829
/**
@@ -50,15 +51,18 @@ public function run($argument) {
5051
$now = new \DateTime();
5152
$now = $now->format('Y-m-d H:i:s');
5253

53-
/*
54+
/**
5455
* Expire file link shares only (for now)
5556
*/
5657
$qb = $connection->getQueryBuilder();
5758
$qb->select('id', 'file_source', 'uid_owner', 'item_type')
5859
->from('share')
5960
->where(
6061
$qb->expr()->andX(
61-
$qb->expr()->eq('share_type', $qb->expr()->literal(\OCP\Share::SHARE_TYPE_LINK)),
62+
$qb->expr()->orX(
63+
$qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_LINK)),
64+
$qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_EMAIL))
65+
),
6266
$qb->expr()->lte('expiration', $qb->expr()->literal($now)),
6367
$qb->expr()->orX(
6468
$qb->expr()->eq('item_type', $qb->expr()->literal('file')),

0 commit comments

Comments
 (0)