aboutsummaryrefslogtreecommitdiffstats
path: root/include/hubloc.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-11-16 08:26:44 +0000
committerMario <mario@mariovavti.com>2020-11-16 08:26:44 +0000
commitdcf883075281e6ad8c66c1f0bf5ec93e67bf83a7 (patch)
tree6a162a049849c4f566ac84cf070429f2f2e4e2e6 /include/hubloc.php
parent06273e980e7aa978d0145f1e5ecd92cbc2aef66e (diff)
parent3d519f478a3769945323c30bb6f7b4879a54a711 (diff)
downloadvolse-hubzilla-dcf883075281e6ad8c66c1f0bf5ec93e67bf83a7.tar.gz
volse-hubzilla-dcf883075281e6ad8c66c1f0bf5ec93e67bf83a7.tar.bz2
volse-hubzilla-dcf883075281e6ad8c66c1f0bf5ec93e67bf83a7.zip
Merge branch 'dev'
Diffstat (limited to 'include/hubloc.php')
-rw-r--r--include/hubloc.php28
1 files changed, 8 insertions, 20 deletions
diff --git a/include/hubloc.php b/include/hubloc.php
index 6b896c627..6ab426a10 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -288,30 +288,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;
}