diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Chanview.php | 9 | ||||
-rw-r--r-- | Zotlabs/Module/Magic.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Mail.php | 7 | ||||
-rw-r--r-- | Zotlabs/Module/Probe.php | 16 | ||||
-rw-r--r-- | Zotlabs/Module/Regdir.php | 13 |
5 files changed, 22 insertions, 31 deletions
diff --git a/Zotlabs/Module/Chanview.php b/Zotlabs/Module/Chanview.php index f70444816..36fbbb864 100644 --- a/Zotlabs/Module/Chanview.php +++ b/Zotlabs/Module/Chanview.php @@ -62,18 +62,15 @@ class Chanview extends \Zotlabs\Web\Controller { } if($_REQUEST['address']) { - $ret = zot_finger($_REQUEST['address'],null); - if($ret['success']) { - $j = json_decode($ret['body'],true); - if($j) - import_xchan($j); + $j = \Zotlabs\Zot\Finger::run($_REQUEST['address'],null); + if($j['success']) { + import_xchan($j); $r = q("select * from xchan where xchan_addr = '%s' limit 1", dbesc($_REQUEST['address']) ); if($r) \App::$poi = $r[0]; } - } } diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php index 63db4a317..6798f72a9 100644 --- a/Zotlabs/Module/Magic.php +++ b/Zotlabs/Module/Magic.php @@ -47,11 +47,9 @@ class Magic extends \Zotlabs\Web\Controller { * */ - $ret = zot_finger((($addr) ? $addr : '[system]@' . $parsed['host']),null); - if($ret['success']) { - $j = json_decode($ret['body'],true); - if($j) - import_xchan($j); + $j = \Zotlabs\Zot\Finger::run((($addr) ? $addr : '[system]@' . $parsed['host']),null); + if($j['success']) { + import_xchan($j); // Now try again diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php index e6487d681..3dbfa8d71 100644 --- a/Zotlabs/Module/Mail.php +++ b/Zotlabs/Module/Mail.php @@ -32,17 +32,16 @@ class Mail extends \Zotlabs\Web\Controller { if(! $recipient) { $channel = \App::get_channel(); - $ret = zot_finger($rstr,$channel); + $j = \Zotlabs\Zot\Finger::run($rstr,$channel); - if(! $ret['success']) { + if(! $j['success']) { notice( t('Unable to lookup recipient.') . EOL); return; } - $j = json_decode($ret['body'],true); logger('message_post: lookup: ' . $url . ' ' . print_r($j,true)); - if(! ($j['success'] && $j['guid'])) { + if(! $j['guid']) { notice( t('Unable to communicate with requested channel.')); return; } diff --git a/Zotlabs/Module/Probe.php b/Zotlabs/Module/Probe.php index 79abe9819..dda792131 100644 --- a/Zotlabs/Module/Probe.php +++ b/Zotlabs/Module/Probe.php @@ -20,17 +20,17 @@ class Probe extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); $addr = trim($_GET['addr']); $do_import = ((intval($_GET['import']) && is_site_admin()) ? true : false); - $res = zot_finger($addr,$channel,false); + + $j = \Zotlabs\Zot\Finger::run($addr,$channel,false); + + // $res = zot_finger($addr,$channel,false); + $o .= '<pre>'; - if($res['success']) - $j = json_decode($res['body'],true); - else { + if(! $j['success']) { $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n"); $o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n"; - $res = zot_finger($addr,$channel,true); - if($res['success']) - $j = json_decode($res['body'],true); - else + $j = \Zotlabs\Zot\Finger::run($addr,$channel,true); + if(! $j['success']) $o .= sprintf( t('Fetching URL returns error: %1$s'),$res['error'] . "\r\n\r\n"); } diff --git a/Zotlabs/Module/Regdir.php b/Zotlabs/Module/Regdir.php index 65f8daf67..48a7cc16d 100644 --- a/Zotlabs/Module/Regdir.php +++ b/Zotlabs/Module/Regdir.php @@ -60,14 +60,11 @@ class Regdir extends \Zotlabs\Web\Controller { json_return_and_die($result); } - $f = zot_finger('[system]@' . $m['host']); - if($f['success']) { - $j = json_decode($f['body'],true); - if($j['success'] && $j['guid']) { - $x = import_xchan($j); - if($x['success']) { - $result['success'] = true; - } + $j = \Zotlabs\Zot\Finger::run('[system]@' . $m['host']); + if($j['success'] && $j['guid']) { + $x = import_xchan($j); + if($x['success']) { + $result['success'] = true; } } |