diff options
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Channel_purge.php | 2 | ||||
-rw-r--r-- | Zotlabs/Daemon/Content_importer.php | 4 | ||||
-rw-r--r-- | Zotlabs/Daemon/Cron.php | 3 | ||||
-rw-r--r-- | Zotlabs/Daemon/Expire.php | 2 | ||||
-rw-r--r-- | Zotlabs/Daemon/Importdoc.php | 18 | ||||
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 5 |
6 files changed, 24 insertions, 10 deletions
diff --git a/Zotlabs/Daemon/Channel_purge.php b/Zotlabs/Daemon/Channel_purge.php index 9fceb0fb9..d25edf8ba 100644 --- a/Zotlabs/Daemon/Channel_purge.php +++ b/Zotlabs/Daemon/Channel_purge.php @@ -24,7 +24,7 @@ class Channel_purge { ); if ($r) { foreach ($r as $rv) { - drop_item($rv['id'], false); + drop_item($rv['id']); } } } while ($r); diff --git a/Zotlabs/Daemon/Content_importer.php b/Zotlabs/Daemon/Content_importer.php index 67f1c8e80..80c9feed1 100644 --- a/Zotlabs/Daemon/Content_importer.php +++ b/Zotlabs/Daemon/Content_importer.php @@ -47,9 +47,9 @@ class Content_importer { killme(); } - $j = json_decode($x['body'],true); + $j = json_decode($x['body'], true); - if(! is_array($j['item']) || ! count($j['item'])) { + if($j && empty($j['item'])) { PConfig::Set($channel['channel_id'], 'import', 'content_completed', 1); return; } diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 3f5ce28eb..186f3efcf 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -76,7 +76,8 @@ class Cron { if ($r) { require_once('include/items.php'); foreach ($r as $rr) { - drop_item($rr['id'], false, (($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL)); + 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']]); diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php index ad52a6b71..3ac3dee3a 100644 --- a/Zotlabs/Daemon/Expire.php +++ b/Zotlabs/Daemon/Expire.php @@ -29,7 +29,7 @@ class Expire { ); if ($r) { foreach ($r as $rr) { - drop_item($rr['id'], false, DROPITEM_PHASE2); + drop_item($rr['id'], DROPITEM_PHASE2); } } diff --git a/Zotlabs/Daemon/Importdoc.php b/Zotlabs/Daemon/Importdoc.php index c5a81e50c..8f04e05f8 100644 --- a/Zotlabs/Daemon/Importdoc.php +++ b/Zotlabs/Daemon/Importdoc.php @@ -18,9 +18,13 @@ class Importdoc { static public function update_docs_dir($s) { $f = basename($s); $d = dirname($s); - if ($s === 'doc/html') + + if ($s === 'doc/html') { return; + } + $files = glob("$d/$f"); + if ($files) { foreach ($files as $fi) { if ($fi === 'doc/html') { @@ -37,6 +41,18 @@ 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); + } + } } } diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 20134b8fe..1693f9c9f 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -299,7 +299,7 @@ class Notifier { return; } - if ($target_item['verb'] === ACTIVITY_SHARE) { + if (in_array($target_item['verb'], [ACTIVITY_SHARE])) { // Provide correct representation across the wire. Internally this is treated as a comment. $target_item['parent_mid'] = $target_item['thr_parent'] = $target_item['mid']; } @@ -374,7 +374,6 @@ class Notifier { if (($relay_to_owner || $uplink) && ($cmd !== 'relay')) { logger('notifier: followup relay', LOGGER_DEBUG); - // If the Parent item is an Announce the real owner is the parent author $sendto = (($uplink) ? $parent_item['source_xchan'] : $parent_item['owner_xchan']); self::$recipients = [$sendto]; self::$private = true; @@ -589,8 +588,6 @@ class Notifier { foreach ($dhubs as $hub) { - logger('notifier_hub: ' . $hub['hubloc_url'], LOGGER_DEBUG); - if ($hub['hubloc_network'] !== 'zot6') { $narr = [ 'channel' => self::$channel, |