diff options
author | Hilmar R <u02@u29lx193> | 2021-01-22 01:38:43 +0100 |
---|---|---|
committer | Hilmar R <u02@u29lx193> | 2021-01-22 01:38:43 +0100 |
commit | 523765b968a5d94a98eee12854fc527d5abbc2e7 (patch) | |
tree | a71caba8943c674917821a4afd333eb39ac92b2e /include/hubloc.php | |
parent | 78f150cfbc1b713bfba3101fdc3f1fd624120637 (diff) | |
parent | 254e30bea173e350a24756cbd8cf4acdfe32933e (diff) | |
download | volse-hubzilla-523765b968a5d94a98eee12854fc527d5abbc2e7.tar.gz volse-hubzilla-523765b968a5d94a98eee12854fc527d5abbc2e7.tar.bz2 volse-hubzilla-523765b968a5d94a98eee12854fc527d5abbc2e7.zip |
Merge branch 'master' into air.5
Diffstat (limited to 'include/hubloc.php')
-rw-r--r-- | include/hubloc.php | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/include/hubloc.php b/include/hubloc.php index 6b896c627..e803b7852 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -4,6 +4,8 @@ * @brief Hubloc related functions. */ +use Zotlabs\Daemon\Master; + /** * @brief Create an array for hubloc table and insert record. * @@ -163,7 +165,7 @@ function remove_obsolete_hublocs() { dbesc($rr['hubloc_hash']) ); if($x) { - Zotlabs\Daemon\Master::Summon(array('Notifier', 'location', $x[0]['channel_id'])); + Master::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id'])); if($interval) @time_sleep_until(microtime(true) + (float) $interval); } @@ -288,30 +290,18 @@ function locations_by_netid($netid) { function ping_site($url) { - $ret = array('success' => false); + $ret = array('success' => false); - $sys = get_sys_channel(); + $r = Zotlabs\Lib\Zotfinger::exec($url); - $m = zot_build_packet($sys, 'ping'); - $r = zot_zot($url . '/post', $m); - if(! $r['success']) { - $ret['message'] = 'no answer from ' . $url; - return $ret; - } - $packet_result = json_decode($r['body'], true); - if(! $packet_result['success']) { - $ret['message'] = 'packet failure from ' . $url; - return $ret; - } + if(! $r['data']) { + $ret['message'] = 'no answer from ' . $url; + return $ret; + } - if($packet_result['success']) { - $ret['success'] = true; - } - else { - $ret['message'] = 'unknown error from ' . $url; - } + $ret['success'] = true; + return $ret; - return $ret; } |