diff options
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Cron_daily.php | 2 | ||||
-rw-r--r-- | Zotlabs/Daemon/Expire.php | 9 | ||||
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 20 |
3 files changed, 27 insertions, 4 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php index 452ef45f1..2cf0c9119 100644 --- a/Zotlabs/Daemon/Cron_daily.php +++ b/Zotlabs/Daemon/Cron_daily.php @@ -96,7 +96,9 @@ class Cron_daily { Master::Summon(array('Cli_suggest')); remove_obsolete_hublocs(); + z6_discover(); + z6trans_connections(); call_hooks('cron_daily',datetime_convert()); diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php index 398425861..f3f42df6f 100644 --- a/Zotlabs/Daemon/Expire.php +++ b/Zotlabs/Daemon/Expire.php @@ -8,6 +8,13 @@ class Expire { static public function run($argc,$argv){ cli_startup(); + + if ($pid = get_config('expire', 'procid', false) && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) { + logger('Expire: procedure already run with PID ' . $pid, LOGGER_DEBUG); + return; + } + + set_config('expire', 'procid', getmypid()); // perform final cleanup on previously delete items @@ -90,5 +97,7 @@ class Expire { logger('Expire: sys: done', LOGGER_DEBUG); } + + del_config('expire', 'procid'); } } diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 00c6fb077..d66079216 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -542,11 +542,10 @@ class Notifier { // Now we have collected recipients (except for external mentions, FIXME) // Let's reduce this to a set of hubs; checking that the site is not dead. - $r = q("select hubloc.*, site.site_crypto, site.site_flags from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ") + $r = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ") and hubloc_error = 0 and hubloc_deleted = 0 and ( site_dead = 0 OR site_dead is null ) " - ); + ); - if(! $r) { logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE); return; @@ -735,7 +734,20 @@ class Notifier { $packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); } - } + } + + if(stripos($hub['site_project'], 'hubzilla') !== false && version_compare($hub['site_version'], '4.7.3', '<=')) { + if($encoded_item['type'] === 'mail') { + $encoded_item['from']['network'] = 'zot'; + $encoded_item['from']['guid_sig'] = str_replace('sha256.', '', $encoded_item['from']['guid_sig']); + } + else { + $encoded_item['owner']['network'] = 'zot'; + $encoded_item['owner']['guid_sig'] = str_replace('sha256.', '', $encoded_item['owner']['guid_sig']); + $encoded_item['author']['network'] = 'zot'; + $encoded_item['author']['guid_sig'] = str_replace('sha256.', '', $encoded_item['author']['guid_sig']); + } + } queue_insert( [ |