start hooking in the new webfinger/zot merged discovery
This commit is contained in:
@@ -1053,11 +1053,14 @@ function discover_by_webbie($webbie) {
|
|||||||
|
|
||||||
$webbie = strtolower($webbie);
|
$webbie = strtolower($webbie);
|
||||||
|
|
||||||
$x = webfinger_rfc7033($webbie);
|
$x = webfinger_rfc7033($webbie,true);
|
||||||
if($x && array_key_exists('links',$x) && $x['links']) {
|
if($x && array_key_exists('links',$x) && $x['links']) {
|
||||||
foreach($x['links'] as $link) {
|
foreach($x['links'] as $link) {
|
||||||
if(array_key_exists('rel',$link) && $link['rel'] == 'http://purl.org/zot/protocol') {
|
if(array_key_exists('rel',$link) && $link['rel'] == 'http://purl.org/zot/protocol') {
|
||||||
logger('discover_by_webbie: zot found for ' . $webbie, LOGGER_DEBUG);
|
logger('discover_by_webbie: zot found for ' . $webbie, LOGGER_DEBUG);
|
||||||
|
if(array_key_exists('zot',$x) && $x['zot']['success'])
|
||||||
|
$i = import_xchan($x['zot']);
|
||||||
|
else {
|
||||||
$z = z_fetch_url($link['href']);
|
$z = z_fetch_url($link['href']);
|
||||||
if($z['success']) {
|
if($z['success']) {
|
||||||
$j = json_decode($z['body'],true);
|
$j = json_decode($z['body'],true);
|
||||||
@@ -1067,6 +1070,7 @@ function discover_by_webbie($webbie) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$arr = array('address' => $webbie, 'success' => false);
|
$arr = array('address' => $webbie, 'success' => false);
|
||||||
call_hooks('discover_by_webbie', $arr);
|
call_hooks('discover_by_webbie', $arr);
|
||||||
|
|||||||
Reference in New Issue
Block a user