diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/dir_fns.php | 5 | ||||
-rw-r--r-- | include/follow.php | 6 | ||||
-rw-r--r-- | include/socgraph.php | 8 | ||||
-rw-r--r-- | include/zot.php | 6 |
4 files changed, 14 insertions, 11 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index 1c3149081..4e300663c 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -69,9 +69,8 @@ function check_upstream_directory() { if ($directory) { $h = parse_url($directory); if ($h) { - $x = zot_finger('[system]@' . $h['host']); - if ($x['success']) { - $j = json_decode($x['body'], true); + $j = Zotlabs\Zot\Finger::run('[system]@' . $h['host']); + if ($j['success']) { if (array_key_exists('site', $j) && array_key_exists('directory_mode', $j['site'])) { if ($j['site']['directory_mode'] === 'normal') { $isadir = false; diff --git a/include/follow.php b/include/follow.php index e4f7e8557..dd43c7c4c 100644 --- a/include/follow.php +++ b/include/follow.php @@ -56,11 +56,11 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) if($arr['channel']['success']) $ret = $arr['channel']; elseif(! $is_http) - $ret = zot_finger($url,$channel); + $ret = Zotlabs\Zot\Finger::run($url,$channel); - if($ret && $ret['success']) { + if($ret && is_array($ret) && $ret['success']) { $is_red = true; - $j = json_decode($ret['body'],true); + $j = $ret; } $my_perms = get_channel_default_perms($uid); diff --git a/include/socgraph.php b/include/socgraph.php index 1b1bccf20..dffaa8923 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -152,11 +152,9 @@ function poco_load($xchan = '', $url = null) { if(($x !== false) && (! count($x))) { if($address) { if($network === 'zot') { - $z = zot_finger($address,null); - if($z['success']) { - $j = json_decode($z['body'],true); - if($j) - import_xchan($j); + $j = Zotlabs\Zot\Finger::run($address,null); + if($j['success']) { + import_xchan($j); } $x = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1", dbesc($hash) diff --git a/include/zot.php b/include/zot.php index 54a3fe640..f5fb87e12 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3672,6 +3672,8 @@ function zotinfo($arr) { $zsig = ((x($arr,'target_sig')) ? $arr['target_sig'] : ''); $zkey = ((x($arr,'key')) ? $arr['key'] : ''); $mindate = ((x($arr,'mindate')) ? $arr['mindate'] : ''); + $token = ((x($arr,'token')) ? $arr['token'] : ''); + $feed = ((x($arr,'feed')) ? intval($arr['feed']) : 0); if($ztarget) { @@ -3816,6 +3818,10 @@ function zotinfo($arr) { // Communication details + if($token) + $ret['signed_token'] = base64url_encode(rsa_sign($token,$e['channel_prvkey'])); + + $ret['guid'] = $e['xchan_guid']; $ret['guid_sig'] = $e['xchan_guid_sig']; $ret['key'] = $e['xchan_pubkey']; |