aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r--Zotlabs/Daemon/Cron_daily.php14
-rw-r--r--Zotlabs/Daemon/Notifier.php7
-rw-r--r--Zotlabs/Daemon/Onedirsync.php3
-rw-r--r--Zotlabs/Daemon/Poller.php4
4 files changed, 11 insertions, 17 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index 07533cc6e..a6daad051 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
+use Zotlabs\Lib\Libzotdir;
+
class Cron_daily {
static public function run($argc,$argv) {
@@ -14,12 +16,11 @@ class Cron_daily {
*/
- require_once('include/dir_fns.php');
- check_upstream_directory();
+ Libzotdir::check_upstream_directory();
// Fire off the Cron_weekly process if it's the correct day.
-
+
$d3 = intval(datetime_convert('UTC','UTC','now','N'));
if($d3 == 7) {
Master::Summon(array('Cron_weekly'));
@@ -80,15 +81,14 @@ class Cron_daily {
downgrade_accounts();
// If this is a directory server, request a sync with an upstream
- // directory at least once a day, up to once every poll interval.
+ // directory at least once a day, up to once every poll interval.
// Pull remote changes and push local changes.
- // potential issue: how do we keep from creating an endless update loop?
+ // potential issue: how do we keep from creating an endless update loop?
$dirmode = get_config('system','directory_mode');
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
- require_once('include/dir_fns.php');
- sync_directories($dirmode);
+ Libzotdir::sync_directories($dirmode);
}
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 18fc57118..626299661 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -466,13 +466,6 @@ class Notifier {
// FIXME add any additional recipients such as mentions, etc.
- // don't send deletions onward for other people's stuff
- // TODO verify this is needed - copied logic from same place in old code
-
- if(intval($target_item['item_deleted']) && (! intval($target_item['item_wall']))) {
- logger('notifier: ignoring delete notification for non-wall item', LOGGER_NORMAL, LOG_NOTICE);
- return;
- }
}
}
diff --git a/Zotlabs/Daemon/Onedirsync.php b/Zotlabs/Daemon/Onedirsync.php
index 2ad76761d..a952b8117 100644
--- a/Zotlabs/Daemon/Onedirsync.php
+++ b/Zotlabs/Daemon/Onedirsync.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
+use Zotlabs\Lib\Libzotdir;
require_once('include/zot.php');
require_once('include/dir_fns.php');
@@ -74,7 +75,7 @@ class Onedirsync {
if($h && ! in_array($h['hubloc_network'], ['zot6', 'zot']))
return;
- update_directory_entry($r[0]);
+ Libzotdir::update_directory_entry($r[0]);
return;
}
diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php
index ebc0584ba..dfa628193 100644
--- a/Zotlabs/Daemon/Poller.php
+++ b/Zotlabs/Daemon/Poller.php
@@ -55,7 +55,6 @@ class Poller {
$force = true;
}
-
$sql_extra = (($manual_id) ? " AND abook_id = " . intval($manual_id) . " " : "");
reload_plugins();
@@ -86,7 +85,6 @@ class Poller {
);
if($contacts) {
-
foreach($contacts as $contact) {
$update = false;
@@ -174,6 +172,8 @@ class Poller {
}
}
+ $dirmode = intval(get_config('system', 'directory_mode'));
+
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$r = q("SELECT u.ud_addr, u.ud_id, u.ud_last FROM updates AS u INNER JOIN (SELECT ud_addr, max(ud_id) AS ud_id FROM updates WHERE ( ud_flags & %d ) = 0 AND ud_addr != '' AND ( ud_last <= '%s' OR ud_last > %s - INTERVAL %s ) GROUP BY ud_addr) AS s ON s.ud_id = u.ud_id ",
intval(UPDATE_FLAGS_UPDATED),