diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-17 18:36:19 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-17 18:36:19 -0700 |
commit | cc95c3e9c81a11d96b6670180f53490ec30e0324 (patch) | |
tree | 3646350c02e363b77ab63a089a6803a4bfdb67ed | |
parent | f0a7a6a1e2517494622206f06b1c21648daf43c7 (diff) | |
download | volse-hubzilla-cc95c3e9c81a11d96b6670180f53490ec30e0324.tar.gz volse-hubzilla-cc95c3e9c81a11d96b6670180f53490ec30e0324.tar.bz2 volse-hubzilla-cc95c3e9c81a11d96b6670180f53490ec30e0324.zip |
start hooking in the new webfinger/zot merged discovery
-rw-r--r-- | include/network.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/network.php b/include/network.php index 48371c5e2..41e1ff37c 100644 --- a/include/network.php +++ b/include/network.php @@ -1053,16 +1053,20 @@ function discover_by_webbie($webbie) { $webbie = strtolower($webbie); - $x = webfinger_rfc7033($webbie); + $x = webfinger_rfc7033($webbie,true); if($x && array_key_exists('links',$x) && $x['links']) { foreach($x['links'] as $link) { if(array_key_exists('rel',$link) && $link['rel'] == 'http://purl.org/zot/protocol') { logger('discover_by_webbie: zot found for ' . $webbie, LOGGER_DEBUG); - $z = z_fetch_url($link['href']); - if($z['success']) { - $j = json_decode($z['body'],true); - $i = import_xchan($j); - return true; + if(array_key_exists('zot',$x) && $x['zot']['success']) + $i = import_xchan($x['zot']); + else { + $z = z_fetch_url($link['href']); + if($z['success']) { + $j = json_decode($z['body'],true); + $i = import_xchan($j); + return true; + } } } } |