zfinger - return all additional hubs

This commit is contained in:
friendica 2012-08-21 21:39:21 -07:00
parent 8a86f73982
commit 72d38d75bf

View File

@ -2,7 +2,7 @@
function zfinger_init(&$a) {
logger('args: ' . print_r($a->argv,true));
require_once('include/zot.php');
$ret = array('success' => false, 'message' => '');
if(argc() > 1) {
@ -32,6 +32,19 @@ logger('args: ' . print_r($a->argv,true));
$ret['sitekey'] = get_config('system','pubkey');
$ret['key'] = $e['pubkey'];
$ret['hubs'] = array();
$x = zot_get_hubloc(array($e['entity_global_id']));
if($x && count($x)) {
foreach($x as $hub) {
$ret['hubs'][] = array(
'primary' => (bool) $hub['hubloc_primary'],
'url' => $hub['hubloc_url'],
'callback' => $hub['hubloc_callback'],
'sitekey' => $hub['hubloc_sitekey']
);
}
}
// more stuff
json_return_and_die($ret);