diff options
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Wfinger.php | 17 | ||||
-rw-r--r-- | Zotlabs/Module/Zfinger.php | 7 |
3 files changed, 14 insertions, 12 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 5e212ad70..dda6d5d95 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2908,7 +2908,7 @@ class Libzot { ]; $ret['channel_role'] = get_pconfig($e['channel_id'],'system','permissions_role','custom'); - $ret['protocols'] = [ 'zot', 'zot6' ]; + $ret['protocols'] = [ 'zot6', 'zot' ]; $ret['searchable'] = $searchable; $ret['adult_content'] = $adult_channel; $ret['public_forum'] = $public_forum; diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php index a19bdbedc..efb380033 100644 --- a/Zotlabs/Module/Wfinger.php +++ b/Zotlabs/Module/Wfinger.php @@ -3,6 +3,7 @@ namespace Zotlabs\Module; require_once('include/zot.php'); +use Zotlabs\Lib\Libzot; class Wfinger extends \Zotlabs\Web\Controller { @@ -128,7 +129,7 @@ class Wfinger extends \Zotlabs\Web\Controller { 'http://webfinger.net/ns/name' => $r[0]['channel_name'], 'http://xmlns.com/foaf/0.1/name' => $r[0]['channel_name'], 'https://w3id.org/security/v1#publicKeyPem' => $r[0]['xchan_pubkey'], - 'http://purl.org/zot/federation' => 'zot,zot6' + 'http://purl.org/zot/federation' => 'zot6,zot' ]; foreach($aliases as $alias) @@ -142,7 +143,7 @@ class Wfinger extends \Zotlabs\Web\Controller { [ 'rel' => 'http://webfinger.net/rel/avatar', 'type' => $r[0]['xchan_photo_mimetype'], - 'href' => $r[0]['xchan_photo_l'] + 'href' => $r[0]['xchan_photo_l'] ], [ @@ -201,11 +202,6 @@ class Wfinger extends \Zotlabs\Web\Controller { 'rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => z_root() . '/follow?f=&url={uri}', ], - - [ - 'rel' => 'http://purl.org/zot/protocol', - 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'], - ], [ 'rel' => 'http://purl.org/zot/protocol/6.0', @@ -214,6 +210,11 @@ class Wfinger extends \Zotlabs\Web\Controller { ], [ + 'rel' => 'http://purl.org/zot/protocol', + 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'], + ], + + [ 'rel' => 'http://purl.org/openwebauth/v1', 'type' => 'application/x-zot+json', 'href' => z_root() . '/owa', @@ -229,7 +230,7 @@ class Wfinger extends \Zotlabs\Web\Controller { if($zot) { // get a zotinfo packet and return it with webfinger - $result['zot'] = zotinfo( [ 'address' => $r[0]['xchan_addr'] ]); + $result['zot'] = Libzot::zotinfo( [ 'address' => $r[0]['xchan_addr'] ]); } } diff --git a/Zotlabs/Module/Zfinger.php b/Zotlabs/Module/Zfinger.php index 3a20144a5..0151d458a 100644 --- a/Zotlabs/Module/Zfinger.php +++ b/Zotlabs/Module/Zfinger.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module; use Zotlabs\Web\HTTPSig; +use Zotlabs\Lib\Libzot; class Zfinger extends \Zotlabs\Web\Controller { @@ -10,10 +11,10 @@ class Zfinger extends \Zotlabs\Web\Controller { require_once('include/zot.php'); require_once('include/crypto.php'); - $x = zotinfo($_REQUEST); + $x = Libzot::zotinfo($_REQUEST); - if($x && $x['guid'] && $x['guid_sig']) { - $chan_hash = make_xchan_hash($x['guid'],$x['guid_sig']); + if($x && $x['id'] && $x['public_key']) { + $chan_hash = Libzot::make_xchan_hash($x['id'],$x['public_key']); if($chan_hash) { $chan = channelx_by_hash($chan_hash); } |