From 9756023e39cb58081b68644e23322cb69c8f0833 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 7 Dec 2024 23:25:59 +0000 Subject: fix expiration --- Zotlabs/Daemon/Cron.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 186f3efcf..4a5d88f8f 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -69,19 +69,18 @@ class Cron { // expire any expired items - $r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s + $r = q("select id, uid, item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s and item_deleted = 0 ", db_utcnow() ); + if ($r) { - require_once('include/items.php'); foreach ($r as $rr) { + // pass uid of the message for permission check as we are running as a daemon process with no session. drop_item($rr['id'], (($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL), uid: intval($rr['uid'])); - if ($rr['item_wall']) { // The notifier isn't normally invoked unless item_drop is interactive. Master::Summon(['Notifier', 'drop', $rr['id']]); - if ($interval) { usleep($interval); } -- cgit v1.2.3