diff options
Diffstat (limited to 'Zotlabs/Daemon/Importdoc.php')
-rw-r--r-- | Zotlabs/Daemon/Importdoc.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/Zotlabs/Daemon/Importdoc.php b/Zotlabs/Daemon/Importdoc.php index 8f04e05f8..de571848e 100644 --- a/Zotlabs/Daemon/Importdoc.php +++ b/Zotlabs/Daemon/Importdoc.php @@ -11,6 +11,21 @@ class Importdoc { self::update_docs_dir('doc/*'); + $sys = get_sys_channel(); + + // remove old files that weren't updated (indicates they were most likely deleted). + $i = q("select id from item where uid = %d and item_type = 5 and edited < %s - INTERVAL %s", + intval($sys['channel_id']), + db_utcnow(), + db_quoteinterval('14 DAY') + ); + + if ($i) { + foreach ($i as $iv) { + drop_item($iv['id'], uid: $sys['channel_id']); + } + } + return; } @@ -41,18 +56,6 @@ class Importdoc { } } } - - // remove old files that weren't updated (indicates they were most likely deleted). - $i = q("select * from item where item_type = 5 and edited < %s - %s", - db_utcnow(), - db_quoteinterval('14 DAY', true) - ); - - if ($i) { - foreach ($i as $iv) { - drop_item($iv['id'], DROPITEM_NORMAL, true); - } - } } } |